configs

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig() error

func WriteConfig

func WriteConfig(config *Config) error

Types

type Auth

type Auth struct {
	Secret string `yaml:"secret" json:"secret"`
}

type Config

type Config struct {
	DataBase     DataBase     `yaml:"database" json:"database"`
	Auth         Auth         `yaml:"auth" json:"auth"`
	DriverConfig DriverConfig `yaml:"driver" json:"driver"`
	SiteConfig   SiteConfig   `yaml:"site" json:"site"`
}
var GlobalConfig *Config

func ReadConfig

func ReadConfig() Config

type DataBase

type DataBase struct {
	Mysql Mysql `ysml:"mysql" json:"mysql"`
}

type DriverConfig

type DriverConfig struct {
	Name   string                 `yaml:"name" json:"name"`
	Config map[string]interface{} `yaml:"config" json:"config"`
}

type Mysql

type Mysql struct {
	Url      string `yaml:"url" json:"url"`
	Port     int    `yaml:"port" json:"port"`
	Database string `yaml:"database" json:"database"`
	Username string `yaml:"username" json:"username"`
	Password string `ysml:"password" json:"password"`
}

type SiteConfig

type SiteConfig struct {
	AllowRegister bool   `yaml:"allowRegister" json:"allowRegister"`
	Title         string `yaml:"title" json:"title"`
	CopyRight     string `yaml:"copyright" json:"copyright"`
}

Jump to

Keyboard shortcuts

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