parameter

package
v0.0.0-...-9058691 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConf

type AuthConf struct {
	TokenTimeout   time.Duration `mapstructure:"token_timeout"`
	CookiePath     string        `mapstructure:"cookie_path"`
	CookieDomain   string        `mapstructure:"cookie_domain"`
	CookieSecure   bool          `mapstructure:"cookie_secure"`
	CookieHttpOnly bool          `mapstructure:"cookie_httpOnly"`
}

type MiddlewareConf

type MiddlewareConf struct {
	RateLimit struct {
		Rate      rate.Limit    `mapstructure:"rate"`
		Burst     int           `mapstructure:"burst"`
		ExpiresIn time.Duration `mapstructure:"expires_in"`
	} `mapstructure:"rate_limit"`
	BodyLimit    string `mapstructure:"body_limit"`
	RecoverSize  int    `mapstructure:"recover_size"`
	LogSkipper   string `mapstructure:"log_skipper"`
	GzipSkipper  string `mapstructure:"gzip_skipper"`
	GzipLevel    int    `mapstructure:"gzip_level"`
	AllowOrigins string `mapstructure:"allow_origins"`
}

type OtherConf

type OtherConf struct {
	CtxTimeout time.Duration `mapstructure:"ctx_timeout"`
	OtpTimeout time.Duration `mapstructure:"otp_timeout"`
}

type ParameterConfig

type ParameterConfig struct {
	ServerConf     `mapstructure:"server"`
	MiddlewareConf `mapstructure:"middleware"`
	PostgresConf   `mapstructure:"postgres"`
	RedisConf      `mapstructure:"redis"`
	AuthConf       `mapstructure:"auth"`
	OtherConf      `mapstructure:"others"`
}

func LoadParameterConfigs

func LoadParameterConfigs(path string) *ParameterConfig

type PostgresConf

type PostgresConf struct {
	MaxOpenConnection     int           `mapstructure:"max_open_conn"`
	MaxIdleConnection     int           `mapstructure:"max_idle_conn"`
	MaxLifetimeConnection time.Duration `mapstructure:"max_lifetime_conn"`
	MaxIdleTimeConnection time.Duration `mapstructure:"max_idle_time_conn"`
	RetryAttempts         int           `mapstructure:"retry_attempts"`
	RetryDelay            time.Duration `mapstructure:"retry_delay"`
	AutoMigrate           bool          `mapstructure:"auto_migrate"`
}

type RedisConf

type RedisConf struct {
	DB           int           `mapstructure:"db"`
	MinIdleConns int           `mapstructure:"min_idle_conns"`
	PoolSize     int           `mapstructure:"pool_size"`
	PoolTimeout  time.Duration `mapstructure:"pool_timeout"`
	IdleTimeout  time.Duration `mapstructure:"idle_timeout"`
}

type ServerConf

type ServerConf struct {
	ShutdownTimeout     time.Duration `mapstructure:"shutdown_timeout"`
	WriteTimeout        time.Duration `mapstructure:"write_timeout"`
	ReadTimeout         time.Duration `mapstructure:"read_timeout"`
	StreamMaxConnection int           `mapstructure:"stream_max_connection"`
}

Jump to

Keyboard shortcuts

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