cfg

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg cfg

Cfg ..

Functions

func GetHostName

func GetHostName(hostName string) string

GetHostName ...

func InitCfg

func InitCfg()

InitCfg ...

Types

type Action added in v0.3.0

type Action struct {
	Enable bool
	URL    string
}

Action ..

type Agent added in v0.3.0

type Agent struct {
	Port   int    `toml:"port"`
	Secret string `toml:"secret"`
}

type App

type App struct {
	Mode           string
	SecretKey      string
	ProductionEnvs []string
}

type AppLog added in v0.3.0

type AppLog struct {
	Enable  bool
	Mode    string
	Aliyun  AppLogAliyun
	Default AppLogDefault
}

AppLog ..

type AppLogAliyun added in v0.3.0

type AppLogAliyun struct {
	Key             string
	Secret          string
	RoleArn         string
	RoleSessionName string
	RegionID        string `json:"regionId" toml:"regionId"`
	LoginURL        string `json:"loginUrl" toml:"loginUrl"`
}

AppLogAliyun ...

type AppLogDefault added in v0.4.0

type AppLogDefault struct {
	DashboardUrl string
	LogStoreUrl  string
	Project      []AppLogDefaultProject
}

AppLogDefault ..

type AppLogDefaultProject added in v0.4.0

type AppLogDefaultProject struct {
	Project         string
	Env             []string
	LogStoreConsole string
	LogStoreJupiter string
	LogStoreBiz     string
}

AppLogDefaultProject ..

type Assist added in v0.3.0

type Assist struct {
	Action Action
}

Assist ..

type Auth

type Auth struct {
	// Auth
	LoginCookieName                  string
	LoginMaximumInactiveLifetimeDays int
	LoginMaximumLifetimeDays         int
	TokenRotationIntervalMinutes     int
	DisableLoginForm                 bool
	DisableSignoutMenu               bool
	SignoutRedirectUrl               string
	OauthAutoLogin                   bool
	OauthStateCookieMaxAge           int
	ApiKeyMaxSecondsToLive           int
}

Auth ...

type Casbin

type Casbin struct {
	Enable           bool
	Debug            bool
	AutoLoad         bool
	AutoLoadInternal int
}

Casbin ..

type ClientProxy

type ClientProxy struct {
	HttpRouter  HttpRouter
	SingleProxy SingleProxy
	MultiProxy  []MultiProxy
}

type Cluster added in v0.4.3

type Cluster struct {
	ZoneCode string
	Domain   string
	Token    string
}

type CodePlatform added in v0.4.0

type CodePlatform struct {
	Token string
}

type Configure

type Configure struct {
	Dirs     []string `json:"dirs"`
	Prefixes []string `json:"prefixes"`
	Agent    struct {
		Port int `json:"port"`
	} `json:"agent"`
	InitEtcdConfig bool `json:"initEtcdConfig"`
}

Configure ..

type Database

type Database struct {
	Enable bool
	// DSN地址: mysql://root:secret@tcp(127.0.0.1:3307)/mysql?timeout=20s&readTimeout=20s
	DSN string `json:"dsn" toml:"dsn"`
	// Debug开关
	Debug bool `json:"debug" toml:"debug"`
	// 最大空闲连接数
	MaxIdleConns int `json:"maxIdleConns" toml:"maxIdleConns"`
	// 最大活动连接数
	MaxOpenConns int `json:"maxOpenConns" toml:"maxOpenConns"`
	// 连接的最大存活时间
	ConnMaxLifetime time.Duration `json:"connMaxLifetime" toml:"connMaxLifetime"`
	// 创建连接的错误级别,=panic时,如果创建失败,立即panic
	OnDialError string `json:"level" toml:"level"`
	// 慢日志阈值
	SlowThreshold time.Duration `json:"slowThreshold" toml:"slowThreshold"`
	// 拨超时时间
	DialTimeout time.Duration `json:"dialTimeout" toml:"dialTimeout"`
	// 关闭指标采集
	DisableMetric bool `json:"disableMetric" toml:"disableMetric"`
	// 关闭链路追踪
	DisableTrace bool `json:"disableTrace" toml:"disableTrace"`
}

type Etcd

type Etcd struct {
	Enable     bool          `json:"enable"`
	ListenAddr string        `json:"listenAddr"`
	Endpoints  []string      `json:"endpoints"`
	Namespace  string        `json:"namespace"`
	Timeout    time.Duration `json:"timeout"`
	TLS        TLS           `json:"tls"`
	BasicAuth  bool          `json:"basicAuth"`
	Password   string        `json:"password"`
	UserName   string        `json:"userName"`
}

type Gateway

type Gateway struct {
	Enable bool
	Name   string
}

type GrafanaProxy

type GrafanaProxy struct {
	Enable bool
	Name   string
}

type GrpcTest added in v0.3.0

type GrpcTest struct {
	Enable   bool
	ProtoDir string
}

type HTTPProxy

type HTTPProxy struct {
	Enable            bool
	ListenAddr        string
	Scheme            string
	Backend           string
	DisableKeepAlives bool
	MaxIdleConns      int
	MaxIdelPerHost    int
	Timeout           int
}

HTTPProxy ..

type HeartBeat

type HeartBeat struct {
	Enable     bool          `json:"enable"`
	Debug      bool          `json:"debug"`
	Addr       string        `json:"addr"`
	Internal   time.Duration `json:"internal"`
	HostName   string        `json:"host_name"`
	RegionCode string        `json:"region_code"`
	RegionName string        `json:"region_name"`
	ZoneCode   string        `json:"zone_code"`
	ZoneName   string        `json:"zone_name"`
	Env        string        `json:"env"`
}

type HttpRouter

type HttpRouter struct {
	GovernConfig string
}

type JunoEvent added in v0.4.2

type JunoEvent struct {
	Rocketmq struct {
		Enable      bool          `yaml:"enable"`
		Addr        []string      `yaml:"addr"`
		Topic       string        `yaml:"topic"`
		Group       string        `yaml:"group"`
		Retry       int           `yaml:"retry"`
		DialTimeout time.Duration `yaml:"dialTimeout"`
	}
}

type K8s added in v0.4.3

type K8s struct {
	LabelAid      string
	Enable        bool
	Prefix        []string
	ExcludeSuffix []string
	Doc           string
	NameSpace     string
}

type Logger

type Logger struct {
	Biz    LoggerInfo
	System LoggerInfo
}

type LoggerInfo

type LoggerInfo struct {
	// Dir 日志输出目录
	Dir string
	// Name 日志文件名称
	Name string
	// Level 日志初始等级
	Level string
	// 日志初始化字段
	Fields []zap.Field
	// 是否添加调用者信息
	AddCaller  bool
	Interval   time.Duration
	CallerSkip int
	Async      bool
	Debug      bool
}

type MultiProxy

type MultiProxy struct {
	Env          string
	ZoneCode     string
	Stream       ProxyStream
	HTTP         HTTPProxy
	DefaultEtcd  Etcd
	RegisterEtcd Etcd
}

MultiProxy ..

type Notice added in v0.4.0

type Notice struct {
	Email struct {
		ServerHost   string   `json:"serverHost" toml:"serverHost"`
		ServerPort   int      `json:"serverPort" toml:"serverPort"`
		FromEmail    string   `json:"fromEmail" toml:"fromEmail"`
		FromPasswd   string   `json:"fromPasswd" toml:"fromPasswd"`
		Subject      string   `json:"subject" toml:"subject"`
		TemplatePath string   `json:"templatePath" toml:"templatePath"`
		Toers        []string `json:"toers" toml:"toers"`
		CCers        []string `json:"cCers" toml:"cCers"`
	}
	Ding struct {
		WebHook string `json:"webHook" toml:"webHook"`
	} `json:"ding" toml:"ding"`
}

type Pprof

type Pprof struct {
	TmpPath     string
	TokenHeader string
	Token       string
	Timeout     time.Duration
	Debug       bool
	StorePath   string
}

type ProxyAuth added in v0.4.0

type ProxyAuth struct {
	Token string
}

type ProxyStream

type ProxyStream struct {
	Enable    bool
	ProxyAddr []string
	Debug     bool
}

type Register

type Register struct {
	Enable         bool
	Endpoints      []string
	ConnectTimeout time.Duration `json:"connectTimeout"`
	Secure         bool          `json:"secure"`
	BasicAuth      bool          `json:"basicAuth" toml:"basicAuth"`
	Password       string        `json:"password" toml:"password"`
	UserName       string        `json:"userName" toml:"userName"`
}

type Server

type Server struct {
	Http   ServerSchema
	Govern ServerSchema
}

Server Server

type ServerProxy

type ServerProxy struct {
	Name         string
	Stream       ProxyStream
	HTTPServer   ServerSchema
	GrpcServer   ServerSchema
	GovernServer ServerSchema
	HeartBeat    HeartBeat
	DefaultEtcd  Etcd
	RegisterEtcd Etcd
	Prometheus   HTTPProxy
}

ServerProxy ..

type ServerSchema

type ServerSchema struct {
	Host           string
	Port           int
	Domain         string
	RootUrl        string
	StaticRootPath string
	EnableGzip     bool
}

type SingleProxy

type SingleProxy struct {
	DefaultEtcd  Etcd
	RegisterEtcd Etcd
}

SingleProxy ..

type TLS

type TLS struct {
	Cert   string `json:"cert"`
	Key    string `json:"key"`
	CaCert string `json:"cacert"`
}

TLS ..

type TestPlatform added in v0.4.0

type TestPlatform struct {
	Enable bool
	Worker struct {
		LocalQueueDir    string
		HeartbeatTimeout time.Duration
	}
}

type UserVisit added in v0.4.3

type UserVisit struct {
	CleanDay uint32 `yaml:"cleanDay"` // 用户访问记录表清除时间
}

Jump to

Keyboard shortcuts

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