config

package
v0.0.0-...-3c0f6d4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   ServerConfig   `yaml:"server"`
	Logger   Logger         `yaml:"logger"`
	Postgres PostgresConfig `yaml:"postgres"`
	Redis    RedisConfig    `yaml:"redis"`
	Session  SessionConfig  `yaml:"session"`
	Cookie   CookieConfig   `yaml:"cookie"`
}

Config

func GetConfig

func GetConfig() *Config

Get the config file

type CookieConfig

type CookieConfig struct {
	Name     string `yaml:"Name"`
	MaxAge   int    `yaml:"MaxAge"`
	Secure   bool   `yaml:"Secure"`
	HTTPOnly bool   `yaml:"HTTPOnly"`
}

type Logger

type Logger struct {
	Development       bool   `yaml:"Development"`
	DisableCaller     bool   `yaml:"DisableCaller"`
	DisableStacktrace bool   `yaml:"DisableStacktrace"`
	Encoding          string `yaml:"Encoding"`
	Level             string `yaml:"Level"`
}

type PostgresConfig

type PostgresConfig struct {
	PostgresqlHost     string `yaml:"PostgresqlHost"`
	PostgresqlPort     string `yaml:"PostgresqlPort"`
	PostgresqlUser     string `yaml:"PostgresqlUser"`
	PostgresqlPassword string `yaml:"PostgresqlPassword"`
	PostgresqlDbname   string `yaml:"PostgresqlDbname"`
	PostgresqlSSLMode  bool   `yaml:"PostgresqlSSLMode"`
	PgDriver           string `yaml:"PgDriver"`
}

Postgresql config

type RedisConfig

type RedisConfig struct {
	RedisAddr      string `yaml:"RedisAddr"`
	RedisPassword  string `yaml:"RedisPassword"`
	RedisDB        string `yaml:"RedisDB"`
	RedisDefaultdb string `yaml:"RedisDefaultdb"`
	MinIdleConns   int    `yaml:"MinIdleConns"`
	PoolSize       int    `yaml:"PoolSize"`
	PoolTimeout    int    `yaml:"PoolTimeout"`
	Password       string `yaml:"Password"`
	DB             int    `yaml:"DB"`
}

type ServerConfig

type ServerConfig struct {
	Port              string `yaml:"Port"`
	Mode              string `yaml:"Mode"`
	JwtSecretKey      string `yaml:"JwtSecretKey"`
	CookieName        string `yaml:"CookieName"`
	ReadTimeout       int    `yaml:"ReadTimeout"`
	WriteTimeout      int    `yaml:"WriteTimeout"`
	SSL               bool   `yaml:"SSL"`
	CtxDefaultTimeout int    `yaml:"CtxDefaultTimeout"`
	CSRF              bool   `yaml:"CSRF"`
}

Server config struct

type SessionConfig

type SessionConfig struct {
	Prefix string `yaml:"Prefix"`
	Name   string `yaml:"Name"`
	Expire int    `yaml:"Expire"`
}

Session Config

Jump to

Keyboard shortcuts

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