configs

package
v0.0.0-...-b81b3d3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(file string)

Types

type Config

type Config struct {
	Mysql    Mysql
	Server   Server
	Jwt      Jwt
	Log      Log
	Job      Job
	WorkFlow WorkFlow
}
var C *Config

func LoadConfig

func LoadConfig(filePath string) *Config

type Job

type Job struct {
	PolicyCron string `yaml:"policyCron"`
	TaskCron   string `yaml:"taskCron"`
}

type Jwt

type Jwt struct {
	Secret string `yaml:"secret"`
}

type Log

type Log struct {
	// 日志路径
	Path string `yaml:"path"`
	// 仅支持:error warn info debug
	Level string `yaml:"level"`
	// 日志切割大小单位MB
	MaxSize int `yaml:"maxSize"`
	// 最大保留个数
	MaxBackups int `yaml:"maxBackups"`
	//  最大保留天数
	MaxAge int `yaml:"maxAge"`
	// 是否压缩日志
	Compress bool `yaml:"compress"`
}

type Mysql

type Mysql struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DataBase string `yaml:"database"`
}

type Server

type Server struct {
	GinMode      string `yaml:"ginMode"`
	Port         string `yaml:"port"`
	ExternalAddr string `yaml:"externalAddr"`
}

type WorkFlow

type WorkFlow struct {
	Driver string `yaml:"driver"`
	Argo   struct {
		URL       string            `yaml:"url"`
		Token     string            `yaml:"token"`
		Templates map[string]string `yaml:"templates"`
	} `yaml:"argo"`
}

Jump to

Keyboard shortcuts

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