configuration

package
v0.0.0-...-eb43240 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(func() (*Config, error) {
		var cfg Config

		if envutils.GetEnvBoolWithDefault("ADMIN_MANAGER_LOCAL", false) {
			if err := godotenv.Load(); err != nil {
				return nil, err
			}
		}

		if err := configor.New(&configor.Config{ErrorOnUnmatchedKeys: true}).Load(&cfg, "cmd/adminmanager/configuration/default.json"); err != nil {
			return nil, err
		}

		return &cfg, nil
	},

		func(cfg *Config) *httpserver.Config { return cfg.AdminManagerHTTP },
		func(cfg *Config) *fxlogger.Config { return cfg.AdminManagerLogger },
		func(cfg *Config) *fxrf.Config { return cfg.AdminManagerResponseFactory },
	),
)

Functions

This section is empty.

Types

type Config

type Config struct {
	AdminManagerLocal           bool `default:"true"`
	AdminManagerHTTP            *httpserver.Config
	AdminManagerLogger          *fxlogger.Config
	AdminManagerResponseFactory *fxrf.Config
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL