Skip to content

Commit

Permalink
SQL Imports / deps / format (#17)
Browse files Browse the repository at this point in the history
* Fixes to DB

* Add WithTeamDirectory() option to client/servers

* Fix version printing and add method to team.Client interface.

* Move transports to example directory

* Print daemon listening status

* Fix log level not printed in status

* Add some stuff to README

* Add more to README

* README

* Add code examples to readme

* README

* README Examples

* README

* Differences with Hashicorp plugins

* Add README to example

* README

* README

* Update ncruces/sqlite dependencies

* Use go1.21 in actions

* Fix cgo build

* Try to fix actions CodeQL

* Tidy comments

* Tidy comments

* Cleanup and comments tidying

* Fix actions

* Remove logging of cleartext credentials

* Fix imports

* Fix client imports

* Fix and restructure imports

* Fix windows action

* Finish server examples code

* Fix imports and update survey version

* Fix imports AGAIN

* Fix wrong server configs directory usage

* Fixes to security alerts

* Update dependencies

* Remove useless imports in cgo build

* Format
  • Loading branch information
maxlandon authored Dec 20, 2023
1 parent 6f5f17c commit 5841cdb
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 34 deletions.
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ linters:
- godox # tool for detection of FIXME, TODO and other comments (style,cmt)
- goerr113 # checks the errors handling expressions (style,err)
# - gofmt # formats and checks for code simplification (fmt)
# - gofumpt # checks whether code was gofumpt-ed (fmt)
- gofumpt # checks whether code was gofumpt-ed (fmt)
- goheader # checks if file header matches to pattern (style)
- goimports # fixes imports, formats code same as gofmt (fmt,import)
# - golint # Deprecated
Expand Down Expand Up @@ -261,7 +261,6 @@ linters:
- forbidigo # Forbids identifiers (style)
- gochecknoglobals # checks that no global variables exist (style)
- gochecknoinits # checks that no init functions are present (style)
# - goimports # fixes imports, formats code same as gofmt (fmt,import)
- lll # Report long lines (style)
- promlinter # checks Prometheus metrics naming via promlint
- rowserrcheck # checks if Err of rows is checked successfully (bugs,sql)
Expand All @@ -281,8 +280,8 @@ linters:
- wrapcheck # checks errors returned from external packages are wrapped (style,err)
- tagliatelle # checks struct tags (style)
- gofmt # formats and checks for code simplification (fmt)
- gofumpt # checks whether code was gofumpt-ed (fmt)
- gci # Controls package import order and makes deterministic (fmt,import)
# - gofumpt # checks whether code was gofumpt-ed (fmt)
# - goimports # fixes imports, formats code same as gofmt (fmt,import)

# Run only fast linters from enabled linters set (first run won't be fast)
# Default: false
Expand Down
3 changes: 1 addition & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ import (
"runtime"
"sync"

"github.com/sirupsen/logrus"

"github.com/reeflective/team"
"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/version"
"github.com/sirupsen/logrus"
)

// Client is the core driver of an application teamclient.
Expand Down
3 changes: 1 addition & 2 deletions client/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import (
"io"
"path/filepath"

"github.com/sirupsen/logrus"

"github.com/reeflective/team/internal/log"
"github.com/sirupsen/logrus"
)

// NamedLogger returns a new logging "thread" with two fields (optional)
Expand Down
3 changes: 1 addition & 2 deletions client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import (
"os"
"strings"

"github.com/sirupsen/logrus"

"github.com/reeflective/team/internal/assets"
"github.com/sirupsen/logrus"
)

const noTeamdir = "no team subdirectory"
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/ncruces/go-sqlite3 v0.8.4
github.com/ncruces/go-sqlite3/gormlite v0.8.4
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rsteube/carapace v0.37.3
github.com/rsteube/carapace v0.47.4
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
google.golang.org/grpc v1.56.1
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -44,6 +44,7 @@ require (
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rsteube/carapace-shlex v0.1.1 // indirect
github.com/stretchr/testify v1.8.2 // indirect
github.com/tetratelabs/wazero v1.4.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -116,12 +117,18 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rsteube/carapace v0.37.3 h1:Us0AnzZ0JiWVHmETSX8PBgp2UJCf/O7KhgSKSpokkII=
github.com/rsteube/carapace v0.37.3/go.mod h1:jkLt41Ne2TD2xPuMdX/2O05Smhy8vMgG7O2TYvC0yOc=
github.com/rsteube/carapace v0.47.4 h1:LwnkFsvRxc2WhZjM63QS7sCi3DlM9XGuATQM5rehgps=
github.com/rsteube/carapace v0.47.4/go.mod h1:4ZC5bulItu9t9sZ5yPcHgPREd8rPf274Q732n+wfl/o=
github.com/rsteube/carapace-shlex v0.1.1 h1:fRQEBBKyYKm4TXUabm4tzH904iFWSmXJl3UZhMfQNYU=
github.com/rsteube/carapace-shlex v0.1.1/go.mod h1:zPw1dOFwvLPKStUy9g2BYKanI6bsQMATzDMYQQybo3o=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
5 changes: 2 additions & 3 deletions internal/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ import (
"path/filepath"
"time"

"github.com/sirupsen/logrus"
"gorm.io/gorm"

"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/db"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)

const (
Expand Down
5 changes: 0 additions & 5 deletions internal/db/sql-cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ package db
*/

import (
// Embedded SQLite instance.
_ "github.com/ncruces/go-sqlite3/embed"
// C-code.
_ "github.com/ncruces/go-sqlite3"

"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/logger"
Expand Down
3 changes: 1 addition & 2 deletions internal/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import (
"io"
"path/filepath"

"github.com/sirupsen/logrus"

"github.com/reeflective/team/internal/assets"
"github.com/sirupsen/logrus"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import (
"path/filepath"
"time"

"github.com/sirupsen/logrus"

"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/command"
"github.com/sirupsen/logrus"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions server/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ import (
"runtime"
"sync"

"github.com/sirupsen/logrus"
"gorm.io/gorm"

"github.com/reeflective/team"
"github.com/reeflective/team/client"
"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/certs"
"github.com/reeflective/team/internal/db"
"github.com/reeflective/team/internal/version"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)

// Server is the core driver of an application teamserver.
Expand Down
3 changes: 1 addition & 2 deletions server/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import (
"path"
"path/filepath"

"gorm.io/gorm"

"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/command"
"github.com/reeflective/team/internal/db"
"gorm.io/gorm"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions server/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ import (
"fmt"
"path/filepath"

"github.com/sirupsen/logrus"

"github.com/reeflective/team/internal/log"
"github.com/sirupsen/logrus"
)

// NamedLogger returns a new logging "thread" with two fields (optional)
Expand Down
5 changes: 2 additions & 3 deletions server/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import (
"os"
"strings"

"github.com/sirupsen/logrus"
"gorm.io/gorm"

"github.com/reeflective/team/internal/assets"
"github.com/reeflective/team/internal/db"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)

const noTeamdir = "no team subdirectory"
Expand Down

0 comments on commit 5841cdb

Please sign in to comment.