config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetName() string
	GetDatabase() *DatabaseConfig
	GetSession() *SessionConfig
	GetSocket() *SocketConfig
	GetRuntime() *RuntimeConfig
	GetConsole() *ConsoleConfig
	GetIAP() *IAPConfig
}

func NewConfig

func NewConfig() Config

NewConfig returns a configuration initialized with defaults.

func Parse

func Parse(args []string) (Config, error)

Parse parses arguments, config files, and env overrides into a Config instance.

type ConsoleConfig

type ConsoleConfig struct {
	Address string `yaml:"address" json:"address"`
}

type DatabaseConfig

type DatabaseConfig struct {
	DSN             string        `yaml:"dsn" json:"dsn"`
	ReadDSN         string        `yaml:"read_dsn" json:"read_dsn"`
	MaxOpenConns    int           `yaml:"max_open_conns" json:"max_open_conns"`
	MaxIdleConns    int           `yaml:"max_idle_conns" json:"max_idle_conns"`
	MaxConnLifetime time.Duration `yaml:"max_conn_lifetime" json:"max_conn_lifetime"`
	MaxConnIdleTime time.Duration `yaml:"max_conn_idle_time" json:"max_conn_idle_time"`
	Migration       bool          `yaml:"migration" json:"migration"`
}

type IAPAppleConfig

type IAPAppleConfig struct {
	SharedPassword          string `yaml:"shared_password" json:"shared_password"`
	NotificationsEndpointID string `yaml:"notifications_endpoint_id" json:"notifications_endpoint_id"`
}

type IAPConfig

type IAPConfig struct {
	Apple           IAPAppleConfig    `yaml:"apple" json:"apple"`
	Google          IAPGoogleConfig   `yaml:"google" json:"google"`
	Huawei          IAPHuaweiConfig   `yaml:"huawei" json:"huawei"`
	FacebookInstant IAPFacebookConfig `yaml:"facebook_instant" json:"facebook_instant"`
	Samsung         IAPSamsungConfig  `yaml:"samsung" json:"samsung"`
}

type IAPFacebookConfig

type IAPFacebookConfig struct {
	AppSecret string `yaml:"app_secret" json:"app_secret"`
}

type IAPGoogleConfig

type IAPGoogleConfig struct {
	ClientEmail             string `yaml:"client_email" json:"client_email"`
	PrivateKey              string `yaml:"private_key" json:"private_key"`
	PackageName             string `yaml:"package_name" json:"package_name"`
	NotificationsEndpointID string `yaml:"notifications_endpoint_id" json:"notifications_endpoint_id"`
}

type IAPHuaweiConfig

type IAPHuaweiConfig struct {
	PublicKey    string `yaml:"public_key" json:"public_key"`
	ClientID     string `yaml:"client_id" json:"client_id"`
	ClientSecret string `yaml:"client_secret" json:"client_secret"`
}

type IAPSamsungConfig

type IAPSamsungConfig struct {
	PackageName string `yaml:"package_name" json:"package_name"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Path    string `yaml:"path" json:"path"`
	HTTPKey string `yaml:"http_key" json:"http_key"`
}

type SessionConfig

type SessionConfig struct {
	EncryptionKey string `yaml:"encryption_key" json:"encryption_key"`
	TokenExpiryMs int64  `yaml:"token_expiry_ms" json:"token_expiry_ms"`
}

type SocketConfig

type SocketConfig struct {
	HTTPAddr string `yaml:"http_addr" json:"http_addr"`
	GRPCAddr string `yaml:"grpc_addr" json:"grpc_addr"`
}

Jump to

Keyboard shortcuts

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