Skip to content

Commit

Permalink
updated mod and added an error in custom cookies from env
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeker12 committed Jul 9, 2024
1 parent 482eb5a commit 8f09772
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
16 changes: 4 additions & 12 deletions httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,10 @@ const ()

// Master struct/object
type Client struct {
// Config
config *ClientConfig

// Integration
config *ClientConfig
Integration *APIIntegration

// Executor
http *http.Client

// Logger
Sugar *zap.SugaredLogger

// Concurrency Mananger
http *http.Client
Sugar *zap.SugaredLogger
Concurrency *concurrency.ConcurrencyHandler
}

Expand Down Expand Up @@ -111,6 +102,7 @@ func (c *ClientConfig) Build() (*Client, error) {
if err != nil {
return nil, fmt.Errorf("invalid configuration: %v", err)
}

c.Sugar.Debug("configuration valid")

httpClient := &http.Client{
Expand Down
2 changes: 2 additions & 0 deletions httpclient/config_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func LoadConfigFromEnv() (*ClientConfig, error) {
Name: parts[0],
Value: parts[1],
})
} else {
return nil, fmt.Errorf("invalid env cookie configuration: %s", parts)
}
}
config.CustomCookies = cookies
Expand Down

0 comments on commit 8f09772

Please sign in to comment.