config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDev  = "dev"
	EnvProd = "prod"
)

Variables

This section is empty.

Functions

func Load

func Load() error

Load will load configurations and update it when changed

Types

type AuthConfig

type AuthConfig struct {
	Username        string
	Password        string
	TokenSecret     string
	TokenExpiration time.Duration
}

func GetAuthConfig

func GetAuthConfig() AuthConfig

type CORSConfig

type CORSConfig struct {
	Enable bool   `toml:"enable"`
	Origin string `toml:"origin"`
}

type Config

type Config struct {
	Server ServerConfig
}

func GetConfig

func GetConfig() Config

type ServerConfig

type ServerConfig struct {
	Env     string
	Address string
	Auth    AuthConfig
	CORS    CORSConfig
	Swagger SwaggerConfig
}

func GetServerConfig

func GetServerConfig() ServerConfig

type SwaggerConfig

type SwaggerConfig struct {
	Host string
	Base string
}

func GetSwaggerConfig

func GetSwaggerConfig() SwaggerConfig

Jump to

Keyboard shortcuts

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