Skip to content

Commit

Permalink
chore: upgrade devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Youen Péron authored Oct 9, 2021
2 parents 61e4af1 + b372513 commit 4eb0989
Show file tree
Hide file tree
Showing 11 changed files with 829 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with LINO. If not, see <http://www.gnu.org/licenses/>.

FROM adrienaury/go-devcontainer:v0.3.1-debian
FROM adrienaury/go-devcontainer:v0.5.1-debian

USER root

Expand Down
49 changes: 29 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
module github.com/cgi-fr/lino

go 1.13
go 1.17

require (
github.com/Trendyol/overlog v0.1.0
github.com/awalterschulze/gographviz v0.0.0-20190522210029-fa59802746ab
github.com/docker/docker-credential-helpers v0.6.3
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/godror/godror v0.20.8
github.com/gorilla/mux v1.7.4
github.com/awalterschulze/gographviz v2.0.3+incompatible
github.com/docker/docker-credential-helpers v0.6.4
github.com/godror/godror v0.27.1
github.com/gorilla/mux v1.8.0
github.com/ibmdb/go_ibm_db v0.4.1
github.com/jmoiron/sqlx v1.2.0
github.com/kr/pretty v0.1.0 // indirect
github.com/lib/pq v1.3.0
github.com/mattn/go-isatty v0.0.13
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/jmoiron/sqlx v1.3.4
github.com/lib/pq v1.10.3
github.com/mattn/go-isatty v0.0.14
github.com/mitchellh/go-homedir v1.1.0
github.com/rs/zerolog v1.21.0
github.com/spf13/cobra v0.0.5
github.com/stretchr/objx v0.1.1 // indirect
github.com/stretchr/testify v1.5.1
github.com/xo/dburl v0.0.0-20200124232849-e9ec94f52bc3
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20191010095647-fc94e3f71652
github.com/rs/zerolog v1.25.0
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
github.com/xo/dburl v0.9.0
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.3.0 // indirect
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
634 changes: 573 additions & 61 deletions go.sum

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions internal/app/localstorage/localstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package localstorage

import (
"bytes"
"fmt"
"io/ioutil"
"os"
Expand Down Expand Up @@ -193,7 +194,11 @@ func readFile() (*YAMLCredentialsStore, error) {
}

func writeFile(list *YAMLCredentialsStore) error {
out, err := yaml.Marshal(list)
out := &bytes.Buffer{}
enc := yaml.NewEncoder(out)
enc.SetIndent(2)

err := enc.Encode(list)
if err != nil {
return err
}
Expand All @@ -215,7 +220,7 @@ func writeFile(list *YAMLCredentialsStore) error {

storeFile := path.Join(storeDir, FileName)

err = ioutil.WriteFile(storeFile, out, 0600)
err = ioutil.WriteFile(storeFile, out.Bytes(), 0600)
if err != nil {
return err
}
Expand Down
14 changes: 7 additions & 7 deletions internal/app/urlbuilder/urlbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ func GenOracleRaw(u *dburl.URL) (string, error) {
func init() {
oracleScheme := dburl.Scheme{
Driver: "godror-raw",
Override: "godror",
Generator: GenOracleRaw,
Transport: dburl.TransportAny,
Opaque: false,
Aliases: []string{"oracle-raw"},
Proto: dburl.ProtoAny,
Override: "godror",
}
dburl.Register(oracleScheme)

Expand All @@ -76,17 +76,17 @@ func init() {
result := fmt.Sprintf("HOSTNAME=%s;DATABASE=%s;PORT=%s;UID=%s;PWD=%s", u.Hostname(), database, u.Port(), u.User.Username(), password)
return result, nil
},
Proto: dburl.ProtoAny,
Opaque: false,
Aliases: []string{"go_ibm_db"},
Override: "go_ibm_db",
Transport: dburl.TransportAny,
Opaque: false,
Aliases: []string{"go_ibm_db"},
Override: "go_ibm_db",
}
dburl.Register(db2Scheme)

httpScheme := dburl.Scheme{
Driver: "http",
Generator: dburl.GenFromURL("http://localhost:8080"),
Proto: dburl.ProtoAny,
Transport: dburl.TransportAny,
Opaque: false,
Aliases: []string{"https"},
Override: "",
Expand Down
15 changes: 2 additions & 13 deletions internal/app/urlbuilder/urlbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package urlbuilder
import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/xo/dburl"
)

Expand All @@ -12,11 +13,6 @@ func TestBuildOracleURL(t *testing.T) {
args string
want string
}{
{
"oracle",
"oracle://user:pwd@dbhost:1521/orclpdb1/?connect_timeout=2",
"user/pwd@//dbhost:1521/orclpdb1",
},
{
"oracle-raw",
"oracle-raw://user:pwd@dbhost:1521/orclpdb1/?connect_timeout=2",
Expand All @@ -27,11 +23,6 @@ func TestBuildOracleURL(t *testing.T) {
"oracle-raw://user:pwd@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb1)))",
`connectString="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb1)))" user="user" password="pwd"`,
},
{
"oracle",
"oracle://user:pwd@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb1)))",
"user/pwd@//(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb1)))",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand All @@ -40,9 +31,7 @@ func TestBuildOracleURL(t *testing.T) {
t.Errorf("parse return error : %v", err)
}

if url.DSN != tt.want {
t.Errorf("DSN should be %s not %v", tt.want, url.DSN)
}
assert.Equal(t, tt.want, url.DSN)
})
}
}
9 changes: 7 additions & 2 deletions internal/infra/dataconnector/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package dataconnector

import (
"bytes"
"io/ioutil"
"os"

Expand Down Expand Up @@ -163,12 +164,16 @@ func readFile() (*YAMLStructure, *dataconnector.Error) {
}

func writeFile(list *YAMLStructure) *dataconnector.Error {
out, err := yaml.Marshal(list)
out := &bytes.Buffer{}
enc := yaml.NewEncoder(out)
enc.SetIndent(2)

err := enc.Encode(list)
if err != nil {
return &dataconnector.Error{Description: err.Error()}
}

err = ioutil.WriteFile("dataconnector.yaml", out, 0600)
err = ioutil.WriteFile("dataconnector.yaml", out.Bytes(), 0600)
if err != nil {
return &dataconnector.Error{Description: err.Error()}
}
Expand Down
9 changes: 7 additions & 2 deletions internal/infra/id/yaml_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package id

import (
"bytes"
"io/ioutil"

"github.com/cgi-fr/lino/pkg/id"
Expand Down Expand Up @@ -112,12 +113,16 @@ func (s *YAMLStorage) Read() (id.IngressDescriptor, *id.Error) {
}

func writeFile(structure *YAMLStructure, filename string) *id.Error {
out, err := yaml.Marshal(structure)
out := &bytes.Buffer{}
enc := yaml.NewEncoder(out)
enc.SetIndent(2)

err := enc.Encode(structure)
if err != nil {
return &id.Error{Description: err.Error()}
}

err = ioutil.WriteFile(filename, out, 0600)
err = ioutil.WriteFile(filename, out.Bytes(), 0600)
if err != nil {
return &id.Error{Description: err.Error()}
}
Expand Down
9 changes: 7 additions & 2 deletions internal/infra/relation/storage_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package relation

import (
"bytes"
"io/ioutil"

"github.com/cgi-fr/lino/pkg/relation"
Expand Down Expand Up @@ -132,12 +133,16 @@ func readFile() (*YAMLStructure, *relation.Error) {
}

func writeFile(list *YAMLStructure) *relation.Error {
out, err := yaml.Marshal(list)
out := &bytes.Buffer{}
enc := yaml.NewEncoder(out)
enc.SetIndent(2)

err := enc.Encode(list)
if err != nil {
return &relation.Error{Description: err.Error()}
}

err = ioutil.WriteFile("relations.yaml", out, 0600)
err = ioutil.WriteFile("relations.yaml", out.Bytes(), 0600)
if err != nil {
return &relation.Error{Description: err.Error()}
}
Expand Down
9 changes: 7 additions & 2 deletions internal/infra/table/storage_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package table

import (
"bytes"
"io/ioutil"

"github.com/cgi-fr/lino/pkg/table"
Expand Down Expand Up @@ -126,12 +127,16 @@ func readFile() (*YAMLStructure, *table.Error) {
}

func writeFile(list *YAMLStructure) *table.Error {
out, err := yaml.Marshal(list)
out := &bytes.Buffer{}
enc := yaml.NewEncoder(out)
enc.SetIndent(2)

err := enc.Encode(list)
if err != nil {
return &table.Error{Description: err.Error()}
}

err = ioutil.WriteFile("tables.yaml", out, 0600)
err = ioutil.WriteFile("tables.yaml", out.Bytes(), 0600)
if err != nil {
return &table.Error{Description: err.Error()}
}
Expand Down
Loading

0 comments on commit 4eb0989

Please sign in to comment.