config

package
v1.0.1-0...-32d7d0a Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name          string  `mapstructure:"APP_NAME"     validate:"required"`
	Log           string  `mapstructure:"APP_LOG"      validate:"required"`
	GcTuner       string  `mapstructure:"APP_GC_TUNER" validate:"required"`
	MemTotal      int     `mapstructure:"APP_MEM_TOTAL"`
	MemLimitRatio float64 `mapstructure:"APP_MEM_LIMIT_RATIO"`
}

type Config

type Config struct {
	Reload         bool                        `mapstructure:"CONFIG_RELOAD"`
	ReloadInterval time.Duration               `mapstructure:"CONFIG_RELOAD_INTERVAL" validate:"required"`
	App            AppConfig                   `mapstructure:",squash"`
	Server         http.ServerConfig           `mapstructure:",squash"`
	Middleware     http.MiddlewareConfig       `mapstructure:",squash"`
	Service        service.ServiceConfig       `mapstructure:",squash"`
	Cache          cache.CacheConfig           `mapstructure:",squash"`
	Compressor     compressor.CompressorConfig `mapstructure:",squash"`
	Database       database.DatabaseConfig     `mapstructure:",squash"`
	Storage        storage.StorageConfig       `mapstructure:",squash"`
	// contains filtered or unexported fields
}

func New

func New(path string) (Config, error)

func (*Config) OnChange

func (c *Config) OnChange(ctx context.Context, fn func())

Jump to

Keyboard shortcuts

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