Documentation ¶
Index ¶
- Variables
- type APIServerConf
- func (a *APIServerConf) WithDisable() *APIServerConf
- func (a *APIServerConf) WithEnable() *APIServerConf
- func (a *APIServerConf) WithHeaderReadTimeout(htimeout int) *APIServerConf
- func (a *APIServerConf) WithHost(host ...string) *APIServerConf
- func (a *APIServerConf) WithTimeout(rtimeout int, wtimout int) *APIServerConf
- func (a *APIServerConf) WithTrace() *APIServerConf
- type Auth
- type Authes
- type Breaker
- type CacheConf
- type CircuitBreaker
- func (c *CircuitBreaker) Append(url string, requestPerSecond int, failedPercent int, rejectPreSecond int) *CircuitBreaker
- func (c *CircuitBreaker) AppendAll(requestPerSecond int, failedPercent int, rejectPreSecond int) *CircuitBreaker
- func (c *CircuitBreaker) WithDisable() *CircuitBreaker
- func (c *CircuitBreaker) WithEnable() *CircuitBreaker
- func (c *CircuitBreaker) WithForceBreak(b bool) *CircuitBreaker
- type Comparer
- type CronServerConf
- func (a *CronServerConf) WitchMasterSlave() *CronServerConf
- func (a *CronServerConf) WitchP2P() *CronServerConf
- func (a *CronServerConf) WitchSharding(i int) *CronServerConf
- func (a *CronServerConf) WithDisable() *CronServerConf
- func (a *CronServerConf) WithEnable() *CronServerConf
- func (a *CronServerConf) WithTimeout(timeout int) *CronServerConf
- func (a *CronServerConf) WithTrace() *CronServerConf
- type CrossDomainHeader
- type DBConf
- func NewDBConf(provider string, connString string, maxOpen int, maxIdle int, lifeTime int) *DBConf
- func NewMysqlConf(uName string, pwd string, serverIP string, dbName string) *DBConf
- func NewMysqlConfForProd(name ...string) *DBConf
- func NewOracleConf(uName string, pwd string, tnsName string) *DBConf
- func NewOracleConfForProd(name ...string) *DBConf
- type Headers
- type Hosts
- type IConf
- type IMainConf
- type IRegistryConf
- type IServerConf
- type ISystemConf
- type IVarConf
- type JSONComparer
- type JSONConf
- func (j *JSONConf) GeJSON(section string) (r []byte, version int32, err error)
- func (j *JSONConf) GetArray(key string, def ...interface{}) (r []interface{})
- func (j *JSONConf) GetBool(key string, def ...bool) (r bool)
- func (j *JSONConf) GetInt(key string, def ...int) int
- func (j *JSONConf) GetRaw() []byte
- func (j *JSONConf) GetSection(section string) (c *JSONConf, err error)
- func (j *JSONConf) GetSignature() string
- func (j *JSONConf) GetString(key string, def ...string) (r string)
- func (j *JSONConf) GetStrings(key string, def ...string) (r []string)
- func (j *JSONConf) GetVersion() int32
- func (j *JSONConf) HasSection(section string) bool
- func (j *JSONConf) Unmarshal(v interface{}) error
- type JWTAuth
- type MQCServerConf
- func (a *MQCServerConf) WitchMasterSlave() *MQCServerConf
- func (a *MQCServerConf) WitchP2P() *MQCServerConf
- func (a *MQCServerConf) WitchSharding(i int) *MQCServerConf
- func (a *MQCServerConf) WithDisable() *MQCServerConf
- func (a *MQCServerConf) WithEnable() *MQCServerConf
- func (a *MQCServerConf) WithTimeout(timeout int) *MQCServerConf
- func (a *MQCServerConf) WithTrace() *MQCServerConf
- type MQTTConf
- type MetadataConf
- type Metric
- type Package
- type Queue
- type QueueConf
- type Queues
- type RPCConf
- type RPCServerConf
- type RedisCacheConf
- type RedisQueueConf
- type RegistryConf
- type Router
- type Routers
- type ServerConf
- func (c *ServerConf) ForceRestart() bool
- func (m ServerConf) Get(key string) interface{}
- func (c *ServerConf) GetAppConf(v interface{}) error
- func (c *ServerConf) GetClusterName() string
- func (c *ServerConf) GetMainConfPath() string
- func (c *ServerConf) GetPlatName() string
- func (c *ServerConf) GetServerName() string
- func (c *ServerConf) GetServerPubRootPath() string
- func (c *ServerConf) GetServerType() string
- func (c *ServerConf) GetServicePubRootPath(svName string) string
- func (c *ServerConf) GetSubConf(name string) (*JSONConf, error)
- func (c *ServerConf) GetSubConfClone() map[string]JSONConf
- func (c *ServerConf) GetSubObject(name string, v interface{}) (int32, error)
- func (c *ServerConf) GetSysName() string
- func (c *ServerConf) GetSystemRootfPath() string
- func (c *ServerConf) GetVarConf(tp string, name string) (*JSONConf, error)
- func (c *ServerConf) GetVarConfClone() map[string]JSONConf
- func (c *ServerConf) GetVarObject(tp string, name string, v interface{}) (int32, error)
- func (c *ServerConf) GetVarVersion() int32
- func (c *ServerConf) HasSubConf(names ...string) bool
- func (c *ServerConf) HasVarConf(tp string, name string) bool
- func (c *ServerConf) IsStop() bool
- func (c *ServerConf) IterSubConf(f func(k string, conf *JSONConf) bool)
- func (c *ServerConf) IterVarConf(f func(k string, conf *JSONConf) bool)
- func (m ServerConf) Set(key string, value interface{})
- func (c *ServerConf) SetSubConf(data map[string]JSONConf)
- func (c *ServerConf) SetVarConf(data map[string]JSONConf)
- type Static
- func (s *Static) AppendExts(exts ...string) *Static
- func (s *Static) WithArchive(archive string) *Static
- func (s *Static) WithDisable() *Static
- func (s *Static) WithEnable() *Static
- func (s *Static) WithExts(exts ...string) *Static
- func (s *Static) WithFirstPage(firstPage string) *Static
- func (s *Static) WithPrefix(prefix string) *Static
- func (s *Static) WithRoot(dir string) *Static
- type Task
- type Tasks
- type View
- type WSServerConf
- type WebServerConf
Constants ¶
This section is empty.
Variables ¶
var ErrNoSetting = errors.New("未配置")
ErrNoSetting 未配置
Functions ¶
This section is empty.
Types ¶
type APIServerConf ¶
type APIServerConf struct { Address string `json:"address,omitempty" valid:"dialstring"` Status string `json:"status,omitempty" valid:"in(start|stop)"` RTimeout int `json:"readTimeout,omitempty"` WTimeout int `json:"writeTimeout,omitempty"` RHTimeout int `json:"readHeaderTimeout,omitempty"` Hosts string `json:"host,omitempty"` Trace bool `json:"trace,omitempty"` }
APIServerConf api server配置信息
func NewAPIServerConf ¶
func NewAPIServerConf(address string) *APIServerConf
NewAPIServerConf 构建api server配置信息
func (*APIServerConf) WithDisable ¶
func (a *APIServerConf) WithDisable() *APIServerConf
WithDisable 禁用任务
func (*APIServerConf) WithEnable ¶
func (a *APIServerConf) WithEnable() *APIServerConf
WithEnable 启用任务
func (*APIServerConf) WithHeaderReadTimeout ¶
func (a *APIServerConf) WithHeaderReadTimeout(htimeout int) *APIServerConf
WithHeaderReadTimeout 构建api server配置信息
func (*APIServerConf) WithHost ¶
func (a *APIServerConf) WithHost(host ...string) *APIServerConf
WithHost 设置host
func (*APIServerConf) WithTimeout ¶
func (a *APIServerConf) WithTimeout(rtimeout int, wtimout int) *APIServerConf
WithTimeout 构建api server配置信息
func (*APIServerConf) WithTrace ¶
func (a *APIServerConf) WithTrace() *APIServerConf
WithTrace 构建api server配置信息
type Auth ¶
type Auth struct { Name string `json:"name" valid:"ascii,required"` ExpireAt int64 `json:"expireAt" valid:"required"` Mode string `json:"mode" valid:"in(HS256|HS384|HS512|RS256|ES256|ES384|ES512|RS384|RS512|PS256|PS384|PS512),required"` Source string `json:"source,omitempty" valid:"in(header|cookie|HEADER|COOKIE|H)"` Secret string `json:"secret" valid:"ascii,required"` Exclude []string `json:"exclude,omitempty"` FailedCode string `json:"failed-code,omitempty" valid:"numeric,range(400|999)"` Redirect string `json:"redirect,omitempty" valid:"ascii"` Domain string `json:"domain,omitempty" valid:"ascii"` Disable bool `json:"disable,omitempty"` }
Auth 安全认证
type Breaker ¶
type Breaker struct { URL string `json:"url" valid:"ascii,required"` RequestPerSecond int `json:"request-per-second,omitempty"` FailedPercent int `json:"failed-request,omitempty"` RejectPerSecond int `json:"reject-per-second,omitempty"` Disable bool `json:"disable,omitempty"` }
Breaker URL熔断配置项
type CircuitBreaker ¶
type CircuitBreaker struct { ForceBreak bool `json:"force-break,omitempty"` Disable bool `json:"disable,omitempty"` SwitchWindow int `json:"swith-window,omitempty"` CircuitBreakers []*Breaker `json:"circuit-breakers,omitempty"` }
CircuitBreaker 熔断配置
func NewCircuitBreaker ¶
func NewCircuitBreaker(window int) *CircuitBreaker
NewCircuitBreaker 构建熔断配置
func (*CircuitBreaker) Append ¶
func (c *CircuitBreaker) Append(url string, requestPerSecond int, failedPercent int, rejectPreSecond int) *CircuitBreaker
Append 添加URL的熔断配置
func (*CircuitBreaker) AppendAll ¶
func (c *CircuitBreaker) AppendAll(requestPerSecond int, failedPercent int, rejectPreSecond int) *CircuitBreaker
AppendAll 所有URL使用此熔断配置
func (*CircuitBreaker) WithDisable ¶
func (c *CircuitBreaker) WithDisable() *CircuitBreaker
WithDisable 禁用熔断配置
func (*CircuitBreaker) WithEnable ¶
func (c *CircuitBreaker) WithEnable() *CircuitBreaker
WithEnable 启用熔断配置
func (*CircuitBreaker) WithForceBreak ¶
func (c *CircuitBreaker) WithForceBreak(b bool) *CircuitBreaker
WithForceBreak 强制熔断
type Comparer ¶
type Comparer struct { Oconf IServerConf Nconf IServerConf *JSONComparer }
func NewComparer ¶
func NewComparer(Oconf IServerConf, Nconf IServerConf) *Comparer
func (*Comparer) IsRequiredSubConfChanged ¶
IsRequiredSubConfChanged 检查必须节点是否发生变化
func (*Comparer) IsSubConfChanged ¶
IsSubConfChanged 检查节点是否发生变化
type CronServerConf ¶
type CronServerConf struct { Status string `json:"status,omitempty" valid:"in(start|stop)"` Sharding int `json:"sharding,omitempty"` Trace bool `json:"trace,omitempty"` Timeout int `json:"timeout,omitempty"` }
func NewCronServerConf ¶
func NewCronServerConf() *CronServerConf
NewCronServerConf 构建mqc server配置,默认为对等模式
func (*CronServerConf) WitchMasterSlave ¶
func (a *CronServerConf) WitchMasterSlave() *CronServerConf
WitchMasterSlave 设置为主备模式
func (*CronServerConf) WitchP2P ¶
func (a *CronServerConf) WitchP2P() *CronServerConf
WitchP2P 设置为对等模式
func (*CronServerConf) WitchSharding ¶
func (a *CronServerConf) WitchSharding(i int) *CronServerConf
WitchSharding 设置为分片模式
func (*CronServerConf) WithDisable ¶
func (a *CronServerConf) WithDisable() *CronServerConf
WithDisable 禁用任务
func (*CronServerConf) WithEnable ¶
func (a *CronServerConf) WithEnable() *CronServerConf
WithEnable 启用任务
func (*CronServerConf) WithTimeout ¶
func (a *CronServerConf) WithTimeout(timeout int) *CronServerConf
WithTimeout 构建api server配置信息
func (*CronServerConf) WithTrace ¶
func (a *CronServerConf) WithTrace() *CronServerConf
WithTrace 构建api server配置信息
type CrossDomainHeader ¶
type CrossDomainHeader = Headers
CrossDomainHeader 跨域配置
func (CrossDomainHeader) WithAllowHeaders ¶
func (c CrossDomainHeader) WithAllowHeaders(header ...string) CrossDomainHeader
WithAllowHeaders 设置允许的头信息
type DBConf ¶
type DBConf struct { Provider string `json:"provider" valid:"required"` ConnString string `json:"connString" valid:"required"` MaxOpen int `json:"maxOpen" valid:"required"` MaxIdle int `json:"maxIdle" valid:"required"` LifeTime int `json:"lifeTime" valid:"required"` }
DBConf 数据库配置
func NewMysqlConf ¶
NewMysqlConf 创建mysql数据库
func NewMysqlConfForProd ¶
NewMysqlConfForProd 创建prod mysql数据库#connectStr
func NewOracleConf ¶
NewOracleConf 创建oracle数据库
func NewOracleConfForProd ¶
NewOracleConfForProd 创建prod oracle数据库#connectStr
type Headers ¶
Headers http头信息
func (Headers) WithCrossDomain ¶
func (imp Headers) WithCrossDomain(host ...string) CrossDomainHeader
WithCrossDomain 添加跨域头配置
type IConf ¶
type IConf interface { GetVersion() int32 GetString(key string, def ...string) (r string) GetStrings(key string, def ...string) (r []string) GetInt(key string, def ...int) int GetArray(key string, def ...interface{}) (r []interface{}) GetBool(key string, def ...bool) (r bool) GeJSON(section string) (r []byte, version int32, err error) GetSection(section string) (c *JSONConf, err error) HasSection(section string) bool GetRaw() []byte Unmarshal(v interface{}) error GetSignature() string }
type IMainConf ¶
type IMainConf interface { IConf GetSystemRootfPath() string GetMainConfPath() string GetServicePubRootPath(name string) string GetServerPubRootPath() string IsStop() bool ForceRestart() bool GetSubObject(name string, v interface{}) (int32, error) GetSubConf(name string) (*JSONConf, error) HasSubConf(name ...string) bool GetSubConfClone() map[string]JSONConf SetSubConf(data map[string]JSONConf) IterSubConf(f func(k string, conf *JSONConf) bool) }
type IRegistryConf ¶
type ISystemConf ¶
type IVarConf ¶
type IVarConf interface { GetVarVersion() int32 GetVarConf(tp string, name string) (*JSONConf, error) GetVarObject(tp string, name string, v interface{}) (int32, error) HasVarConf(tp string, name string) bool GetVarConfClone() map[string]JSONConf SetVarConf(map[string]JSONConf) IterVarConf(f func(k string, conf *JSONConf) bool) }
type JSONComparer ¶
func NewJSONComparer ¶
func NewJSONComparer(Oconf IConf, Nconf IConf) *JSONComparer
func (*JSONComparer) IsChanged ¶
func (s *JSONComparer) IsChanged() bool
func (*JSONComparer) IsValueChanged ¶
func (s *JSONComparer) IsValueChanged(names ...string) (isChanged bool)
IsValueChanged 检查值是否发生变化
type JSONConf ¶
type JSONConf struct {
// contains filtered or unexported fields
}
JSONConf json配置文件
func NewJSONConf ¶
NewJSONConf 初始化JsonConf
func NewJSONConfByMap ¶
NewJSONConfByMap 根据map初始化对象
func (*JSONConf) GetSection ¶
GetSection 指定节点名称获取JSONConf
func (*JSONConf) GetStrings ¶
GetStrings 获取字符串数组
type JWTAuth ¶
type JWTAuth struct {
*Auth
}
func (*JWTAuth) WithCookieStore ¶
WithCookieStore 将jwt信息存储到cookie中
func (*JWTAuth) WithFailedCode ¶
WithFailedCode 设置jwt验证失败后的返回给客户端的错误码
func (*JWTAuth) WithHeaderStore ¶
WithHeaderStore 将jwt信息存储到header中
func (*JWTAuth) WithRedirect ¶
WithRedirect 设置jwt验证失败后的跳转地址
type MQCServerConf ¶
type MQCServerConf struct { Status string `json:"status,omitempty" valid:"in(start|stop)"` Sharding int `json:"sharding,omitempty"` Trace bool `json:"trace,omitempty"` Timeout int `json:"timeout,omitempty"` }
func NewMQCServerConf ¶
func NewMQCServerConf() *MQCServerConf
NewMQCServerConf 构建mqc server配置,默认为对等模式
func (*MQCServerConf) WitchMasterSlave ¶
func (a *MQCServerConf) WitchMasterSlave() *MQCServerConf
WitchMasterSlave 设置为主备模式
func (*MQCServerConf) WitchSharding ¶
func (a *MQCServerConf) WitchSharding(i int) *MQCServerConf
WitchSharding 设置为分片模式
func (*MQCServerConf) WithDisable ¶
func (a *MQCServerConf) WithDisable() *MQCServerConf
WithDisable 禁用任务
func (*MQCServerConf) WithEnable ¶
func (a *MQCServerConf) WithEnable() *MQCServerConf
WithEnable 启用任务
func (*MQCServerConf) WithTimeout ¶
func (a *MQCServerConf) WithTimeout(timeout int) *MQCServerConf
WithTimeout 构建api server配置信息
func (*MQCServerConf) WithTrace ¶
func (a *MQCServerConf) WithTrace() *MQCServerConf
WithTrace 构建api server配置信息
type MetadataConf ¶
func (*MetadataConf) GetMetadata ¶
func (s *MetadataConf) GetMetadata(key string) interface{}
func (*MetadataConf) SetMetadata ¶
func (s *MetadataConf) SetMetadata(key string, v interface{})
type Metric ¶
type Metric struct { Host string `json:"host" valid:"requrl,required"` DataBase string `json:"dataBase" valid:"ascii,required"` Cron string `json:"cron" valid:"ascii,required"` UserName string `json:"userName,omitempty" valid:"ascii"` Password string `json:"password,omitempty" valid:"ascii"` Disable bool `json:"disable,omitempty"` }
type Package ¶
type Queue ¶
type Queue struct { Name string `json:"name,omitempty" valid:"ascii"` Queue string `json:"queue" valid:"ascii,required"` Engine string `json:"engine,omitempty" valid:"ascii,uppercase,in(*|RPC)"` Service string `json:"service" valid:"ascii,required"` Setting map[string]string `json:"args,omitempty"` Concurrency int `json:"concurrency,omitempty"` Disable bool `json:"disabl,omitemptye"` Handler interface{} }
func NewQueueWithConcurrency ¶
NewQueueWithConcurrency 构建Queue注册项
func (*Queue) WithConcurrency ¶
WithConcurrency 设置并发协程数
type Queues ¶
type RPCServerConf ¶
type RPCServerConf struct { Address string `json:"address,omitempty" valid:"dialstring"` Status string `json:"status,omitempty" valid:"in(start|stop)"` RTimeout int `json:"readTimeout,omitempty"` WTimeout int `json:"writeTimeout,omitempty"` RHTimeout int `json:"readHeaderTimeout,omitempty"` Trace bool `json:"trace,omitempty"` }
RPCServerConf api server配置信息
func NewRPCServerConf ¶
func NewRPCServerConf(address string) *RPCServerConf
NewRPCServerConf 构建api server配置信息
func (*RPCServerConf) WithDisable ¶
func (a *RPCServerConf) WithDisable() *RPCServerConf
WithDisable 禁用任务
func (*RPCServerConf) WithEnable ¶
func (a *RPCServerConf) WithEnable() *RPCServerConf
WithEnable 启用任务
func (*RPCServerConf) WithTrace ¶
func (a *RPCServerConf) WithTrace() *RPCServerConf
WithTrace 构建api server配置信息
type RedisCacheConf ¶
type RedisCacheConf = CacheConf
RedisCacheConf redis消息队列
func NewRedisCacheConf ¶
func NewRedisCacheConf(dbIndex int, address ...string) RedisCacheConf
NewRedisCacheConf 构建redis消息队列配置
func NewRedisCacheConfForProd ¶
func NewRedisCacheConfForProd(dbIndex int, name ...string) RedisCacheConf
NewRedisCacheConfForProd 创建prod redis配置
func (RedisCacheConf) WithPoolSize ¶
func (m RedisCacheConf) WithPoolSize(poolSize int) RedisCacheConf
WithPoolSize 修改连接数
func (RedisCacheConf) WithTimeout ¶
func (m RedisCacheConf) WithTimeout(dialTimeout int, readTimeout int, writeTimeout int, poolSize int) RedisCacheConf
WithTimeout 设置超时时长
type RedisQueueConf ¶
type RedisQueueConf QueueConf
RedisQueueConf redis消息队列
func NewRedisQueueConf ¶
func NewRedisQueueConf(address []string, dbIndex int) RedisQueueConf
NewRedisQueueConf 构建redis消息队列配置
func NewRedisQueueConfForProd ¶
func NewRedisQueueConfForProd(dbIndex int, name ...string) RedisQueueConf
NewRedisQueueConfForProd 创建prod redis配置
func (RedisQueueConf) WithTimeout ¶
func (m RedisQueueConf) WithTimeout(dialTimeout int, readTimeout int, writeTimeout int, poolSize int) RedisQueueConf
WithTimeout 设置超时时长
type RegistryConf ¶
type RegistryConf struct {
// contains filtered or unexported fields
}
RegistryConf 基于注册中心的配置管理器
func NewRegistryConf ¶
func NewRegistryConf(rgst registry.IRegistry) (s *RegistryConf)
NewRegistryConf 构建服务器配置缓存
type Router ¶
type Router struct { Name string `json:"name,omitempty" valid:"ascii,required"` Action []string `json:"action,omitempty" valid:"uppercase,in(GET|POST|PUT|DELETE|HEAD|TRACE|OPTIONS)"` Engine string `json:"engine,omitempty" valid:"ascii,uppercase,in(*|RPC)"` Service string `json:"service" valid:"ascii,required"` Setting map[string]string `json:"args,omitempty"` Disable bool `json:"disable,omitempty"` Handler interface{} }
type Routers ¶
type Routers struct { Setting map[string]string `json:"args,omitempty"` Routers []*Router `json:"routers,omitempty"` }
type ServerConf ¶
type ServerConf struct { *JSONConf // contains filtered or unexported fields }
ServerConf 服务器配置信息
func NewServerConf ¶
func NewServerConf(mainConfpath string, mainConfRaw []byte, mainConfVersion int32, rgst registry.IRegistry) (s *ServerConf, err error)
NewServerConf 构建服务器配置缓存
func (*ServerConf) GetAppConf ¶
func (c *ServerConf) GetAppConf(v interface{}) error
GetAppConf 获取系统配置
func (*ServerConf) GetClusterName ¶
func (c *ServerConf) GetClusterName() string
GetClusterName 获取集群名称
func (*ServerConf) GetMainConfPath ¶
func (c *ServerConf) GetMainConfPath() string
GetMainConfPath 获取主配置文件路径
func (*ServerConf) GetServerName ¶
func (c *ServerConf) GetServerName() string
GetServerName 获取服务器名称
func (*ServerConf) GetServerPubRootPath ¶
func (c *ServerConf) GetServerPubRootPath() string
GetServerPubRootPath 获取服务器发布的跟路径
func (*ServerConf) GetServerType ¶
func (c *ServerConf) GetServerType() string
GetServerType 获取服务器类型
func (*ServerConf) GetServicePubRootPath ¶
func (c *ServerConf) GetServicePubRootPath(svName string) string
GetServicePubRootPath 获取服务发布跟路径
func (*ServerConf) GetSubConf ¶
func (c *ServerConf) GetSubConf(name string) (*JSONConf, error)
GetSubConf 指定配置文件名称,获取系统配置信息
func (*ServerConf) GetSubConfClone ¶
func (c *ServerConf) GetSubConfClone() map[string]JSONConf
GetSubConfClone 获取sub配置拷贝
func (*ServerConf) GetSubObject ¶
func (c *ServerConf) GetSubObject(name string, v interface{}) (int32, error)
GetSubObject 获取子系统配置
func (*ServerConf) GetSystemRootfPath ¶
func (c *ServerConf) GetSystemRootfPath() string
GetSystemRootfPath 获取系统根路径
func (*ServerConf) GetVarConf ¶
func (c *ServerConf) GetVarConf(tp string, name string) (*JSONConf, error)
GetVarConf 指定配置文件名称,获取var配置信息
func (*ServerConf) GetVarConfClone ¶
func (c *ServerConf) GetVarConfClone() map[string]JSONConf
GetVarConfClone 获取var配置拷贝
func (*ServerConf) GetVarObject ¶
func (c *ServerConf) GetVarObject(tp string, name string, v interface{}) (int32, error)
GetVarObject 指定配置文件名称,获取var配置信息
func (*ServerConf) GetVarVersion ¶
func (c *ServerConf) GetVarVersion() int32
GetVarVersion 获取var路径版本号
func (*ServerConf) HasSubConf ¶
func (c *ServerConf) HasSubConf(names ...string) bool
HasSubConf 是否存在子级配置
func (*ServerConf) HasVarConf ¶
func (c *ServerConf) HasVarConf(tp string, name string) bool
HasVarConf 是否存在子级配置
func (*ServerConf) IterSubConf ¶
func (c *ServerConf) IterSubConf(f func(k string, conf *JSONConf) bool)
IterSubConf 迭代所有子配置
func (*ServerConf) IterVarConf ¶
func (c *ServerConf) IterVarConf(f func(k string, conf *JSONConf) bool)
IterVarConf 迭代所有子配置
func (*ServerConf) SetSubConf ¶
func (c *ServerConf) SetSubConf(data map[string]JSONConf)
SetSubConf 获取sub配置参数
func (*ServerConf) SetVarConf ¶
func (c *ServerConf) SetVarConf(data map[string]JSONConf)
SetVarConf 获取var配置参数
type Static ¶
type Static struct { Dir string `json:"dir,omitempty" valid:"ascii"` Archive string `json:"archive,omitempty" valid:"ascii"` Prefix string `json:"prefix,omitempty" valid:"ascii"` Exts []string `json:"exts,omitempty" valid:"ascii"` Exclude []string `json:"exclude,omitempty" valid:"ascii"` FirstPage string `json:"first-page,omitempty" valid:"ascii"` Rewriters []string `json:"rewriters,omitempty" valid:"ascii"` Disable bool `json:"disable,omitempty"` }
Static 设置静态文件配置
func NewWebServerStaticConf ¶
func NewWebServerStaticConf() *Static
NewWebServerStaticConf 构建Web服务静态文件配置
func (*Static) AppendExts ¶
AppendExts 设置静态文件跟目录
func (*Static) WithArchive ¶
WithArchive 设置静态文件跟目录
func (*Static) WithFirstPage ¶
WithFirstPage 设置静首页地址
type Task ¶
type Task struct { Name string `json:"name,omitempty" valid:"ascii"` Cron string `json:"cron" valid:"ascii,required"` Input map[string]interface{} `json:"input,omitempty"` Engine string `json:"engine,omitempty" valid:"ascii,uppercase,in(*|RPC)"` Service string `json:"service" valid:"ascii,required"` Setting map[string]string `json:"args,omitempty"` Next string `json:"next,omitempty"` Last string `json:"last,omitempty"` Handler interface{} `json:"handler,omitempty"` Disable bool `json:"disable,omitempty"` }
type Tasks ¶
type View ¶
type View struct { Path string `json:"path" valid:"ascii,required"` Left string `json:"left,omitempty" valid:"ascii"` Right string `json:"right,omitempty" valid:"ascii"` Files []string Disable bool `json:"disable,omitempty"` }
View web服务器view解析配置
type WSServerConf ¶
type WSServerConf struct { Address string `json:"address,omitempty" valid:"dialstring"` Status string `json:"status,omitempty" valid:"in(start|stop)"` RTimeout int `json:"readTimeout,omitempty"` WTimeout int `json:"writeTimeout,omitempty"` RHTimeout int `json:"readHeaderTimeout,omitempty"` Trace bool `json:"trace,omitempty"` }
WSServerConf api server配置信息
func NewWSServerConf ¶
func NewWSServerConf(address string) *WSServerConf
NewWSServerConf 构建api server配置信息
func (*WSServerConf) WithDisable ¶
func (a *WSServerConf) WithDisable() *WSServerConf
WithDisable 禁用任务
func (*WSServerConf) WithTrace ¶
func (a *WSServerConf) WithTrace() *WSServerConf
WithTrace 构建api server配置信息
type WebServerConf ¶
type WebServerConf = APIServerConf
WebServerConf web服务器配置
func NewWebServerConf ¶
func NewWebServerConf(address string) *WebServerConf
NewWebServerConf 构建api server配置信息
Source Files ¶
- comparer.go
- crypt.go
- jcomparer.go
- json.conf.go
- registry.conf.go
- server.conf.go
- sub.conf.api.go
- sub.conf.auth.go
- sub.conf.circuit.go
- sub.conf.cron.go
- sub.conf.go
- sub.conf.header.go
- sub.conf.meta.go
- sub.conf.metric.go
- sub.conf.mqc.go
- sub.conf.once.go
- sub.conf.package.go
- sub.conf.queue.go
- sub.conf.router.go
- sub.conf.rpc.go
- sub.conf.static.go
- sub.conf.task.go
- sub.conf.view.go
- sub.conf.web.go
- sub.conf.ws.go
- var.conf.cache.go
- var.conf.db.go
- var.conf.queue.go
- var.conf.rpc.go