config

package
v0.0.0-...-118fa08 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins []string `mapstructure:"allowed_origins"`
}

CORSConfig holds cors-related config

type CasbinConfig

type CasbinConfig struct {
	Model  string `mapstructure:"model"`
	Policy string `mapstructure:"policy"`
}

CasbinConfig holds casbin-related config

type Config

type Config struct {
	Prod bool

	HTTP     HTTPConfig     `mapstructure:"http"`
	DB       DBConfig       `mapstructure:"db"`
	Security SecurityConfig `mapstructure:"security"`
}

Config holds app-wide config

func Load

func Load() (*Config, error)

Load loads the config

type DBConfig

type DBConfig struct {
	Name string
	URI  string
}

DBConfig holds db-related config

type HTTPConfig

type HTTPConfig struct {
	Host string
	Port string

	CORS CORSConfig `mapstructure:"cors"`
}

HTTPConfig holds http-related config

type SecurityConfig

type SecurityConfig struct {
	PasswordSalt string `mapstructure:"password_salt"`
	StoreSecret  string `mapstructure:"store_secret"`
	SessionKey   string `mapstructure:"session_key"`
	CSRFSecret   string `mapstructure:"csrf_secret"`

	Casbin CasbinConfig `mapstructure:"casbin"`
}

SecurityConfig holds security-related config

Jump to

Keyboard shortcuts

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