Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApolloSource ¶
type ApolloSource struct {
// contains filtered or unexported fields
}
ApolloSource loads and watches a namespace in Apollo.
func NewApolloSource ¶
func NewApolloSource(appID, cluster, namespaceName, metaAddr string, p parser.Parser) (*ApolloSource, error)
NewApolloSource creates an ApolloSource.
- appID: Apollo AppId
- cluster: cluster name (usually "default")
- namespaceName: namespace to watch (e.g., "config", "myapp.yaml")
- metaAddr: Apollo Meta Server address (e.g., "http://localhost:8080")
- p: parser matching the config format stored in the namespace (usually JSON/YAML)
func (*ApolloSource) Load ¶
func (as *ApolloSource) Load(ctx context.Context) (map[string]interface{}, error)
func (*ApolloSource) Name ¶
func (as *ApolloSource) Name() string
type ConsulSource ¶
type ConsulSource struct {
// contains filtered or unexported fields
}
ConsulSource loads and watches a key in Consul KV.
func NewConsulSource ¶
func NewConsulSource(addr, key string, p parser.Parser) (*ConsulSource, error)
NewConsulSource creates a ConsulSource.
- addr: Consul agent address (e.g., "127.0.0.1:8500")
- key: KV path (e.g., "config/myapp.yaml")
- p: parser matching the value format stored in Consul
func (*ConsulSource) Load ¶
func (cs *ConsulSource) Load(ctx context.Context) (map[string]interface{}, error)
func (*ConsulSource) Name ¶
func (cs *ConsulSource) Name() string
type EtcdSource ¶
type EtcdSource struct {
// contains filtered or unexported fields
}
EtcdSource loads and watches a key in etcd.
func NewEtcdSource ¶
NewEtcdSource creates a new EtcdSource. The parser must match the value format.
func (*EtcdSource) Load ¶
func (es *EtcdSource) Load(ctx context.Context) (map[string]interface{}, error)
func (*EtcdSource) Name ¶
func (es *EtcdSource) Name() string
type NacosSource ¶
type NacosSource struct {
// contains filtered or unexported fields
}
NacosSource loads and watches a configuration from Nacos.
func NewNacosSource ¶
func NewNacosSource(serverAddr, namespaceID, dataID, group string, p parser.Parser) (*NacosSource, error)
NewNacosSource creates a NacosSource. The parser must match the config format (e.g. YAML).
func (*NacosSource) Load ¶
func (ns *NacosSource) Load(ctx context.Context) (map[string]interface{}, error)
func (*NacosSource) Name ¶
func (ns *NacosSource) Name() string