Skip to content

Commit

Permalink
feat: Propagate cache configration to the root data type
Browse files Browse the repository at this point in the history
  • Loading branch information
Neurostep committed Apr 22, 2024
1 parent 0b89529 commit 82666f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

app "github.com/scribd/go-sdk/pkg/app"
"github.com/scribd/go-sdk/pkg/cache"
database "github.com/scribd/go-sdk/pkg/database"
instrumentation "github.com/scribd/go-sdk/pkg/instrumentation"
logger "github.com/scribd/go-sdk/pkg/logger"
Expand All @@ -21,6 +22,7 @@ type Config struct {
Server *server.Config
Tracking *tracking.Config
PubSub *pubsub.Config
Cache *cache.Config
}

// NewConfig returns a new Config instance
Expand Down Expand Up @@ -63,13 +65,19 @@ func NewConfig() (*Config, error) {
errGroup = wrapErrors(errGroup, fmt.Errorf("pubsub config err: %w", err))
}

cacheConfig, err := cache.NewConfig()
if err != nil {
errGroup = wrapErrors(errGroup, fmt.Errorf("cache config err: %w", err))
}

config.App = appConfig
config.Database = dbConfig
config.Instrumentation = instrumentationConfig
config.Logger = loggerConfig
config.Server = serverConfig
config.Tracking = trackingConfig
config.PubSub = pubsubConfig
config.Cache = cacheConfig

return config, errGroup
}
Expand Down

0 comments on commit 82666f5

Please sign in to comment.