conf

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init, init the config file.

Types

type Base

type Base struct {
	Title            string
	SystemLanguage   string
	BeginTime        time.Time
	RestTime         [][]time.Time
	EndTime          time.Time
	Duration         uint
	SeparateFrontend bool
	Sentry           bool
	Port             string
	Salt             string
	FlagPrefix       string
	FlagSuffix       string
	CheckDownScore   int
	AttackScore      int
}

Base is the basic config of the cardinal.

type Config

type Config struct {
	Base  `toml:"base";gorm:"-"`
	MySQL `toml:"mysql";gorm:"-"`

	*DynamicConfig
}

Config is the config of the cardinal.

func Get

func Get() *Config

Get returns the config struct.

type DynamicConfig added in v0.6.0

type DynamicConfig struct {
	gorm.Model `json:"-"`
}

DynamicConfig is the config which is stored in database. So it's a GORM model for users can edit it anytime.

type MySQL

type MySQL struct {
	DBHost     string
	DBUsername string
	DBPassword string
	DBName     string
}

MySQL is the database config of the cardinal.

Jump to

Keyboard shortcuts

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