config

package
v0.0.0-...-135a279 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string) (*viper.Viper, error)

Types

type CasbinConfig

type CasbinConfig struct {
	DbMode        bool   `mapstructure:"MODE"`
	PostgresTable string `mapstructure:"POSTGRES_TABLE"`
	ModelConfig   string `mapstructure:"MODEL_CONFIG"`
	Policy        string `mapstructure:"POLICY"`
}

type Config

type Config struct {
	Server   ServerConfig   `mapstructure:"SERVER"`
	Logger   Logger         `mapstructure:"LOGGER"`
	Postgres PostgresConfig `mapstructure:"POSTGRES"`
	Casbin   CasbinConfig   `mapstructure:"CASBIN"`
}

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

type Logger

type Logger struct {
	Development bool   `mapstructure:"DEVELOPMENT"`
	Encoding    string `mapstructure:"ENCODING"`
	Level       string `mapstructure:"LEVEL"`
}

type PostgresConfig

type PostgresConfig struct {
	Host     string `mapstructure:"HOST"`
	Port     string `mapstructure:"PORT"`
	User     string `mapstructure:"USER"`
	Password string `mapstructure:"PASSWORD"`
	Database string `mapstructure:"DATABASE"`
	Driver   string `mapstructure:"DRIVER"`
}

type ServerConfig

type ServerConfig struct {
	Host        string `mapstructure:"HOST"`
	Port        string `mapstructure:"PORT"`
	Environment string `mapstructure:"ENVIRONMENT"`
}

Jump to

Keyboard shortcuts

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