conf

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (

	// BasicMachine is machine code (same to private cluster)
	BasicMachine = "basic.machine"

	// BasicInstance is key for Host name
	BasicInstance = "basic.instance"
	// BasicAppName is key for app name
	BasicAppName = "basic.appName"
	// BasicAppVersion is key for app version
	BasicAppVersion = "basic.appVersion"
)

Variables

This section is empty.

Functions

func SetDefaultBasicConfig

func SetDefaultBasicConfig()

SetDefaultBasicConfig set default basic config

Types

type BasicConfig

type BasicConfig struct {
	Zone            string  `toml:"zone" json:"zone,omitempty"`                       // deployment environment zone code
	Node            string  `toml:"node" json:"node,omitempty"`                       // node
	Machine         string  `toml:"machine" json:"machine,omitempty"`                 // machine
	Service         string  `toml:"service" json:"service,omitempty"`                 // service
	Instance        string  `json:"instance,omitempty"`                               // instance
	AppName         string  `json:"app_name,omitempty"`                               // app name
	AppVersion      string  `json:"app_version,omitempty"`                            // app version
	IsDevMode       bool    `toml:"devMode" json:"is_dev_mode,omitempty"`             // dev mode
	APIRoot         string  `toml:"apiRoot" json:"api_root,omitempty"`                // restful api root path
	APIPort         int     `toml:"apiPort" json:"api_port,omitempty"`                // api export port
	IsProf          bool    `toml:"prof" json:"is_prof,omitempty"`                    // open pProf
	IsDynamicConfig bool    `toml:"dynamicConfig" json:"is_dynamic_config,omitempty"` // use dynamic config
	CPUCount        int     `toml:"cpu" json:"cpu_count,omitempty"`                   // cpu count
	IsAPIRate       bool    `toml:"isApiRate" json:"is_api_rate,omitempty"`           // whether to enable rate limit
	IsAPIBody       bool    `toml:"isApiBody" json:"is_api_body,omitempty"`           // whether to enable body limit
	IsAPITimeout    bool    `toml:"isApiTimeout" json:"is_api_timeout,omitempty"`     // whether to enable timeout limit
	APIRate         float64 `toml:"apiRate" json:"rate,omitempty"`                    // rate
	APIBurst        int     `toml:"apiBurst" json:"burst,omitempty"`                  // burst value. the number if times increased when the request reaches the rate limit.
	APIExpiresIn    int     `toml:"apiExpires" json:"expires_in,omitempty"`           // expire time
	APIBodyLimit    string  `toml:"apiBodyLimit" json:"body_limit,omitempty"`         // query body limit. eg: 10MB
	APITimeout      int     `toml:"apiTimeout" json:"timeout,omitempty"`              // api timeout. ms
	InSwarm         bool    `toml:"inSwarm" json:"inSwarm,omitempty"`                 // in swarm
	WorkLoad        int     `toml:"workLoad" json:"work_load,omitempty"`              // work load
}

BasicConfig 基本配置

func GetBasicConfig

func GetBasicConfig() *BasicConfig

GetBasicConfig get basic config

Jump to

Keyboard shortcuts

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