config

package
v0.0.0-...-2f27ceb Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 4 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 Config

type Config struct {
	Server  ServerConfig
	MongoDB MongoDB
	Logger  Logger
	Session Session
	Cookie  Cookie
}

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)
type Cookie struct {
	Name     string
	MaxAge   int
	Secure   bool
	HttpOnly bool
}

type Logger

type Logger struct {
	Development       bool
	DisableCaller     bool
	DisableStacktrace bool
	Encoding          string
	Level             string
}

type MongoDB

type MongoDB struct {
	MongoURI string
	Username string
	Password string
}

type ServerConfig

type ServerConfig struct {
	AppVersion        string
	Port              string
	PprofPort         string
	Mode              string
	JwtSecretKey      string
	CookieName        string
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	SSL               bool
	CtxDefaultTimeout time.Duration
	CSRF              bool
	Debug             bool
}

type Session

type Session struct {
	Prefix string
	Name   string
	Expire int
}

Jump to

Keyboard shortcuts

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