Documentation
¶
Index ¶
- Variables
- func Bootstrap(scanTarget []ScanTarget, onChanges CfgOnChanges)
- func MustNewNacosSource(group, cfgFile string) kcfg.Source
- func NewNacosSource(group, cfgFile string) (kcfg.Source, error)
- type Adapter
- type Adapter_Database
- func (*Adapter_Database) Descriptor() ([]byte, []int)deprecated
- func (x *Adapter_Database) GetDriver() string
- func (x *Adapter_Database) GetSource() string
- func (*Adapter_Database) ProtoMessage()
- func (x *Adapter_Database) ProtoReflect() protoreflect.Message
- func (x *Adapter_Database) Reset()
- func (x *Adapter_Database) String() string
- type Adapter_Redis
- func (*Adapter_Redis) Descriptor() ([]byte, []int)deprecated
- func (x *Adapter_Redis) GetAddr() string
- func (x *Adapter_Redis) GetReadTimeout() *durationpb.Duration
- func (x *Adapter_Redis) GetWriteTimeout() *durationpb.Duration
- func (*Adapter_Redis) ProtoMessage()
- func (x *Adapter_Redis) ProtoReflect() protoreflect.Message
- func (x *Adapter_Redis) Reset()
- func (x *Adapter_Redis) String() string
- type CfgOnChanges
- type Discovery
- type File
- func (*File) Descriptor() ([]byte, []int)deprecated
- func (x *File) GetCompress() bool
- func (x *File) GetMaxAge() int32
- func (x *File) GetMaxBackups() int32
- func (x *File) GetMaxSize() int32
- func (*File) ProtoMessage()
- func (x *File) ProtoReflect() protoreflect.Message
- func (x *File) Reset()
- func (x *File) String() string
- type GatewayRegister
- type Log
- type Monitor
- type Public
- func (*Public) Descriptor() ([]byte, []int)deprecated
- func (x *Public) GetAdapter() *Adapter
- func (x *Public) GetDiscovery() *Discovery
- func (x *Public) GetGatewayRegister() *GatewayRegister
- func (x *Public) GetLog() *Log
- func (x *Public) GetRegistry() *Registry
- func (x *Public) GetTrace() *Trace
- func (*Public) ProtoMessage()
- func (x *Public) ProtoReflect() protoreflect.Message
- func (x *Public) Reset()
- func (x *Public) String() string
- type Registry
- type ScanTarget
- type Trace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileNotExist = func(f string) error { return errors.Newf("config file not exist:%v", f) } ErrNoCfgSource = errors.Newf("no found config source") )
View Source
var File_common_conf_public_proto protoreflect.FileDescriptor
Functions ¶
func Bootstrap ¶
func Bootstrap(scanTarget []ScanTarget, onChanges CfgOnChanges)
根据运行环境,加载指定的配置文件cfgFile, 并解析到指定的结构scanTarget,注册配置更新回调函数onChanges
func MustNewNacosSource ¶
Types ¶
type Adapter ¶
type Adapter struct {
Database *Adapter_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
Redis *Adapter_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"`
// contains filtered or unexported fields
}
func (*Adapter) Descriptor
deprecated
func (*Adapter) GetDatabase ¶
func (x *Adapter) GetDatabase() *Adapter_Database
func (*Adapter) GetRedis ¶
func (x *Adapter) GetRedis() *Adapter_Redis
func (*Adapter) ProtoMessage ¶
func (*Adapter) ProtoMessage()
func (*Adapter) ProtoReflect ¶
func (x *Adapter) ProtoReflect() protoreflect.Message
type Adapter_Database ¶
type Adapter_Database struct {
Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"`
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
// contains filtered or unexported fields
}
func (*Adapter_Database) Descriptor
deprecated
func (*Adapter_Database) Descriptor() ([]byte, []int)
Deprecated: Use Adapter_Database.ProtoReflect.Descriptor instead.
func (*Adapter_Database) GetDriver ¶
func (x *Adapter_Database) GetDriver() string
func (*Adapter_Database) GetSource ¶
func (x *Adapter_Database) GetSource() string
func (*Adapter_Database) ProtoMessage ¶
func (*Adapter_Database) ProtoMessage()
func (*Adapter_Database) ProtoReflect ¶
func (x *Adapter_Database) ProtoReflect() protoreflect.Message
func (*Adapter_Database) Reset ¶
func (x *Adapter_Database) Reset()
func (*Adapter_Database) String ¶
func (x *Adapter_Database) String() string
type Adapter_Redis ¶
type Adapter_Redis struct {
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
ReadTimeout *durationpb.Duration `protobuf:"bytes,2,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"`
WriteTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"`
// contains filtered or unexported fields
}
func (*Adapter_Redis) Descriptor
deprecated
func (*Adapter_Redis) Descriptor() ([]byte, []int)
Deprecated: Use Adapter_Redis.ProtoReflect.Descriptor instead.
func (*Adapter_Redis) GetAddr ¶
func (x *Adapter_Redis) GetAddr() string
func (*Adapter_Redis) GetReadTimeout ¶
func (x *Adapter_Redis) GetReadTimeout() *durationpb.Duration
func (*Adapter_Redis) GetWriteTimeout ¶
func (x *Adapter_Redis) GetWriteTimeout() *durationpb.Duration
func (*Adapter_Redis) ProtoMessage ¶
func (*Adapter_Redis) ProtoMessage()
func (*Adapter_Redis) ProtoReflect ¶
func (x *Adapter_Redis) ProtoReflect() protoreflect.Message
func (*Adapter_Redis) Reset ¶
func (x *Adapter_Redis) Reset()
func (*Adapter_Redis) String ¶
func (x *Adapter_Redis) String() string
type Discovery ¶
type Discovery struct {
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
// contains filtered or unexported fields
}
func (*Discovery) Descriptor
deprecated
func (*Discovery) GetEndpoints ¶
func (*Discovery) ProtoMessage ¶
func (*Discovery) ProtoMessage()
func (*Discovery) ProtoReflect ¶
func (x *Discovery) ProtoReflect() protoreflect.Message
type File ¶
type File struct {
MaxSize int32 `protobuf:"varint,1,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"`
MaxBackups int32 `protobuf:"varint,2,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"`
MaxAge int32 `protobuf:"varint,3,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"`
Compress bool `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"`
// contains filtered or unexported fields
}
func (*File) Descriptor
deprecated
func (*File) GetCompress ¶
func (*File) GetMaxBackups ¶
func (*File) GetMaxSize ¶
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) ProtoReflect ¶
func (x *File) ProtoReflect() protoreflect.Message
type GatewayRegister ¶ added in v0.1.1
type GatewayRegister struct {
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
// contains filtered or unexported fields
}
func (*GatewayRegister) Descriptor
deprecated
added in
v0.1.1
func (*GatewayRegister) Descriptor() ([]byte, []int)
Deprecated: Use GatewayRegister.ProtoReflect.Descriptor instead.
func (*GatewayRegister) GetEndpoints ¶ added in v0.1.1
func (x *GatewayRegister) GetEndpoints() []string
func (*GatewayRegister) ProtoMessage ¶ added in v0.1.1
func (*GatewayRegister) ProtoMessage()
func (*GatewayRegister) ProtoReflect ¶ added in v0.1.1
func (x *GatewayRegister) ProtoReflect() protoreflect.Message
func (*GatewayRegister) Reset ¶ added in v0.1.1
func (x *GatewayRegister) Reset()
func (*GatewayRegister) String ¶ added in v0.1.1
func (x *GatewayRegister) String() string
type Log ¶
type Log struct {
Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"`
Monitor *Monitor `protobuf:"bytes,2,opt,name=monitor,proto3" json:"monitor,omitempty"`
File *File `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"`
// contains filtered or unexported fields
}
func (*Log) Descriptor
deprecated
func (*Log) GetMonitor ¶
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) ProtoReflect ¶
func (x *Log) ProtoReflect() protoreflect.Message
type Monitor ¶
type Monitor struct {
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
// contains filtered or unexported fields
}
func (*Monitor) Descriptor
deprecated
func (*Monitor) GetEndpoint ¶
func (*Monitor) ProtoMessage ¶
func (*Monitor) ProtoMessage()
func (*Monitor) ProtoReflect ¶
func (x *Monitor) ProtoReflect() protoreflect.Message
type Public ¶
type Public struct {
Log *Log `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"`
Trace *Trace `protobuf:"bytes,2,opt,name=trace,proto3" json:"trace,omitempty"`
Registry *Registry `protobuf:"bytes,3,opt,name=registry,proto3" json:"registry,omitempty"`
Discovery *Discovery `protobuf:"bytes,4,opt,name=discovery,proto3" json:"discovery,omitempty"`
Adapter *Adapter `protobuf:"bytes,5,opt,name=adapter,proto3" json:"adapter,omitempty"`
GatewayRegister *GatewayRegister `protobuf:"bytes,6,opt,name=gateway_register,json=gatewayRegister,proto3" json:"gateway_register,omitempty"`
// contains filtered or unexported fields
}
func (*Public) Descriptor
deprecated
func (*Public) GetAdapter ¶
func (*Public) GetDiscovery ¶
func (*Public) GetGatewayRegister ¶ added in v0.1.1
func (x *Public) GetGatewayRegister() *GatewayRegister
func (*Public) GetRegistry ¶
func (*Public) ProtoMessage ¶
func (*Public) ProtoMessage()
func (*Public) ProtoReflect ¶
func (x *Public) ProtoReflect() protoreflect.Message
type Registry ¶
type Registry struct {
Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"`
// contains filtered or unexported fields
}
func (*Registry) Descriptor
deprecated
func (*Registry) ProtoMessage ¶
func (*Registry) ProtoMessage()
func (*Registry) ProtoReflect ¶
func (x *Registry) ProtoReflect() protoreflect.Message
type ScanTarget ¶ added in v0.1.0
type Trace ¶
type Trace struct {
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
// contains filtered or unexported fields
}
func (*Trace) Descriptor
deprecated
func (*Trace) GetEndpoint ¶
func (*Trace) ProtoMessage ¶
func (*Trace) ProtoMessage()
func (*Trace) ProtoReflect ¶
func (x *Trace) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.