serverConfig

package
v0.0.0-...-a97389e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeartbeatInterval = 15
	JobCheckInterval  = 15

	WsDefaultNameSpace = "default"
	WsDefaultRoom      = "default"
	WsEvent            = "OnChat"

	ApiPath = "/api/v1"
	WsPath  = ApiPath + "/ws"

	ZentaoCasePrefix   = "zentao-case-"
	ZentaoModulePrefix = "zentao-module-"
)
View Source
const (
	WinFileSchema = "winfile:///"
)

Variables

View Source
var (
	CONFIG     Config              // 配置
	VIPER      *viper.Viper        // viper
	PermRoutes []map[string]string // 权限路由
)
View Source
var (
	SortMap = map[string]string{
		"ascend":  "ASC",
		"descend": "DESC",
		"":        "ASC",
	}
)

Functions

func GetServerWorDir

func GetServerWorDir() (ret string)

func Init

func Init()

func InitExecLog

func InitExecLog(workspacePath string)

write exec results by using zap log

func InitLog

func InitLog()

func SyncExecLog

func SyncExecLog()

flush buffer and release the file.

Types

type Config

type Config struct {
	MaxSize int64     `mapstructure:"max-size" json:"burst" yaml:"max-size"`
	System  System    `mapstructure:"system" json:"system" yaml:"system"`
	Limit   Limit     `mapstructure:"limit" json:"limit" yaml:"limit"`
	Zap     myZap.Zap `mapstructure:"zap" json:"zap" yaml:"zap"`

	Host   string
	Server string
	Ip     string
	Port   int

	AuthToken   string
	ExpiredDate time.Time
}

type Limit

type Limit struct {
	Disable bool    `mapstructure:"disable" json:"disable" yaml:"disable"`
	Limit   float64 `mapstructure:"limit" json:"limit" yaml:"limit"`
	Burst   int     `mapstructure:"burst" json:"burst" yaml:"burst"`
}

type System

type System struct {
	Version      string `mapstructure:"version" json:"version" yaml:"version"`
	Level        string `mapstructure:"level" json:"level" yaml:"level"` // debug,release,test
	Addr         string `mapstructure:"addr" json:"addr" yaml:"addr"`
	StaticPrefix string `mapstructure:"static-prefix" json:"staticPrefix" yaml:"static-prefix"`
	StaticPath   string `mapstructure:"static-path" json:"staticPath" yaml:"static-path"`
	WebPath      string `mapstructure:"web-path" json:"webPath" yaml:"web-path"`
	DbType       string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
	TimeFormat   string `mapstructure:"time-format" json:"timeFormat" yaml:"time-format"`
}

Jump to

Keyboard shortcuts

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