config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	UseSpaceCache    bool `json:"use_space_cache" toml:"use_space_cache"`
	UseAccountCache  bool `json:"use_account_cache" toml:"use_account_cache"`
	UseTemplateCache bool `json:"use_template_cache" toml:"use_template_cache"`
}

type CryptoConfig

type CryptoConfig struct {
	AESKey string `json:"-" toml:"aes_key"`
	AESIV  string `json:"-" toml:"aes_iv"`
}

func (*CryptoConfig) Check

func (cc *CryptoConfig) Check() error

type DatabaseConfig

type DatabaseConfig struct {
	Address         string   `json:"address" toml:"address"`
	Username        string   `json:"username" toml:"username"`
	Password        string   `json:"-" toml:"password"`
	Database        string   `json:"database" toml:"database"`
	MaxIdleConns    int      `json:"max_idle_conns" toml:"max_idle_conns"`
	MaxOpenConns    int      `json:"max_open_conns" toml:"max_open_conns"`
	ConnMaxLifetime Duration `json:"conn_max_lifetime" toml:"conn_max_lifetime"`
	ConnMaxIdleTime Duration `json:"conn_max_idle_time" toml:"conn_max_idle_time"`
	ReportStatsTime Duration `json:"report_stats_time" toml:"report_stats_time"`
}

type Duration

type Duration time.Duration

func (*Duration) Standard

func (d *Duration) Standard() time.Duration

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type PostarAdminConfig

type PostarAdminConfig struct {
	Logger   logitconf.Config `json:"logger" toml:"logger"`
	Server   ServerConfig     `json:"server" toml:"server"`
	Database DatabaseConfig   `json:"database" toml:"database"`
	Crypto   CryptoConfig     `json:"crypto" toml:"crypto"`
}

PostarAdminConfig stores all configurations of postar-admin.

func NewPostarAdminConfig

func NewPostarAdminConfig() *PostarAdminConfig

NewPostarAdminConfig returns a new config for postar-admin.

func (*PostarAdminConfig) Check

func (pac *PostarAdminConfig) Check() error

type PostarConfig

type PostarConfig struct {
	Logger   logitconf.Config `json:"logger" toml:"logger"`
	Server   ServerConfig     `json:"server" toml:"server"`
	Database DatabaseConfig   `json:"database" toml:"database"`
	Crypto   CryptoConfig     `json:"crypto" toml:"crypto"`
	Cache    CacheConfig      `json:"cache" toml:"cache"`
}

PostarConfig stores all configurations of postar.

func NewPostarConfig

func NewPostarConfig() *PostarConfig

NewPostarConfig returns a new config for postar.

func (*PostarConfig) Check

func (pc *PostarConfig) Check() error

type ServerConfig

type ServerConfig struct {
	Type               string   `json:"type" toml:"type"`
	GrpcEndpoint       string   `json:"grpc_endpoint" toml:"grpc_endpoint"`
	HttpEndpoint       string   `json:"http_endpoint" toml:"http_endpoint"`
	UseTLS             bool     `json:"use_tls" toml:"use_tls"`
	CertFile           string   `json:"cert_file" toml:"cert_file"`
	KeyFile            string   `json:"key_file" toml:"key_file"`
	RequestTimeout     Duration `json:"request_timeout" toml:"request_timeout"`
	CloseServerTimeout Duration `json:"close_server_timeout" toml:"close_server_timeout"`
}

Jump to

Keyboard shortcuts

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