config

package
v0.0.0-...-bb1b5f2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init loads all configs

func LoadAdmin

func LoadAdmin()

LoadAdmin loads admin panel configuration

func LoadApp

func LoadApp()

LoadApp reads config from file

func LoadCrypto

func LoadCrypto()

LoadCrypto reads config from file

func LoadDB

func LoadDB()

LoadDB loads DB configuration

func LoadSession

func LoadSession()

LoadSession reads config from file

Types

type AdminCfg

type AdminCfg struct {
	AdminUsername string
	AdminPassword string
}

AdminCfg holds the admin panel configuration

func Admin

func Admin() *AdminCfg

Admin returns the default admin panel configuration

type AppCfg

type AppCfg struct {
	Host             string
	Port             int
	ReadTimeout      time.Duration
	WriteTimeout     time.Duration
	IdleTimeout      time.Duration
	HttpTimeout      time.Duration
	CorsAllowedHosts []string
	StoragePath      string
	RoomList         []string
	RoomListMap      map[string]bool
	UserPrintLimit   int
}

AppCfg stores app related configs

func App

func App() *AppCfg

App returns current app config

type CryptoCfg

type CryptoCfg struct {
	Key string
}

CryptoCfg stores crypto related configs

func Crypto

func Crypto() *CryptoCfg

Crypto returns current app config

type DBCfg

type DBCfg struct {
	Host            string
	Username        string
	Password        string
	Name            string
	Port            int
	MaxIdleConn     int
	MaxOpenConn     int
	MaxConnLifetime time.Duration
}

DBCfg holds the database configuration

func DB

func DB() *DBCfg

DB returns the default DB configuration

type SessionCfg

type SessionCfg struct {
	SessionKey string
}

SessionCfg stores session related configs

func Session

func Session() *SessionCfg

Session returns current app config

Jump to

Keyboard shortcuts

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