configs

package
v0.4.2-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 timex.Duration `json:"conn_max_lifetime" toml:"conn_max_lifetime"`
	ConnMaxIdleTime timex.Duration `json:"conn_max_idle_time" toml:"conn_max_idle_time"`
	ReportStatsTime timex.Duration `json:"report_stats_time" toml:"report_stats_time"`
}

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"`
}

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     timex.Duration `json:"request_timeout" toml:"request_timeout"`
	CloseServerTimeout timex.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