Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove config provider interface pointer #106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func buildCLI() *cli.App {
cfgProvider := fs_config_provider.NewFSConfigProvider(configDir, env)

s := server.NewServer(
server_options.WithConfigProvider(&cfgProvider),
server_options.WithConfigProvider(cfgProvider),
)
defer s.Stop()
err := s.Start()
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type (
// NewServer returns a new instance of server that serves one or many services.
func NewServer(opts ...server_options.ServerOption) *Server {
serverOpts := server_options.NewServerOptions(opts)
cfgProvider, err := config.NewConfigProviderWithRefresh(*serverOpts.ConfigProvider)
cfgProvider, err := config.NewConfigProviderWithRefresh(serverOpts.ConfigProvider)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion server/server_options/server_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type (
)

// WithConfigProvider supplies the config for the UI server
func WithConfigProvider(cfgProvider *config.ConfigProvider) ServerOption {
func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption {
return newApplyFuncContainer(func(s *ServerOptions) {
s.ConfigProvider = cfgProvider
})
Expand Down
2 changes: 1 addition & 1 deletion server/server_options/server_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

type (
ServerOptions struct {
ConfigProvider *config.ConfigProvider
ConfigProvider config.ConfigProvider
}
)

Expand Down