config

package
v0.0.0-...-f2c37c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Token string `mapstructure:"token"`
	Port  int    `mapstructure:"port"`
}

type AppConfig

type AppConfig struct {
	Serve           string `mapstructure:"serve"`
	Port            int    `mapstructure:"port"`
	Socket          string `mapstructure:"socket"`
	Cookie          string `mapstructure:"cookie"`
	SessionLifetime int    `mapstructure:"session_lifetime"`
}

type Balance

type Balance struct {
	Path   string `mapstructure:"path"`
	Method string `mapstructure:"method"`
}

type Config

type Config struct {
	App    AppConfig    `mapstructure:"app"`
	Redis  RedisConfig  `mapstructure:"redis"`
	Worker WorkerConfig `mapstructure:"worker"`
	API    ApiConfig    `mapstructure:"api"`
}

func InitConfig

func InitConfig() (*Config, error)

type RedisConfig

type RedisConfig struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
}

type WorkerConfig

type WorkerConfig struct {
	HealthEndpoint string    `mapstructure:"health"`
	Balance        []Balance `mapstructure:"balance"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳