Documentation
¶
Index ¶
- Constants
- func MustUnmarshalYaml(content string, value any, zeroFields ...bool)
- func UnmarshalYaml(content string, value any, zeroFields ...bool) error
- type Apollo
- type Config
- type MockClient
- func (c *MockClient) GetAllKeys(opts ...agollo.OpOption) []string
- func (c *MockClient) GetContent(opts ...agollo.OpOption) string
- func (c *MockClient) GetPropertiesContent(opts ...agollo.OpOption) string
- func (c *MockClient) GetReleaseKey(opts ...agollo.OpOption) string
- func (c *MockClient) GetString(key string, opts ...agollo.OpOption) string
- func (c *MockClient) OnUpdate(f func(*agollo.ChangeEvent))
- func (c *MockClient) Start() error
- func (c *MockClient) Stop() error
- func (c *MockClient) SubscribeToNamespaces(namespaces ...string) error
Constants ¶
View Source
const (
// DefaultCluster 默认集群
DefaultCluster = "default"
)
Variables ¶
This section is empty.
Functions ¶
func MustUnmarshalYaml ¶
MustUnmarshalYaml 将 content 字符串 yaml 反序列化到 value 中
Types ¶
type Apollo ¶
Apollo 阿波罗配置中心客户端
func (*Apollo) GetNamespaceContent ¶
GetNamespaceContent 获取给定 namespace 的具体 content
func (*Apollo) GetNamespaceValue ¶
GetNamespaceValue 获取给定 namespace 的 key 所对应的 value
type Config ¶
type Config struct {
IsMock bool `json:",optional"` // 是否模拟
AppID string `json:",optional"` // 应用ID
Cluster string `json:",default=default"` // 集群
NameSpaceNames []string `json:",optional"` // 命名空间
CacheDir string `json:",optional"` // 配置缓存目录
MetaAddr string `json:",optional"` // 服务地址
AccessKeySecret string `json:",optional"` // 访问鉴权密钥
InsecureSkipVerify bool `json:",optional"` // 跳过安全验证
}
Config 阿波罗配置中心客户端配置
type MockClient ¶
type MockClient struct{}
MockClient ...
func (*MockClient) GetAllKeys ¶
func (c *MockClient) GetAllKeys(opts ...agollo.OpOption) []string
GetAllKeys ...
func (*MockClient) GetContent ¶
func (c *MockClient) GetContent(opts ...agollo.OpOption) string
GetContent ...
func (*MockClient) GetPropertiesContent ¶
func (c *MockClient) GetPropertiesContent(opts ...agollo.OpOption) string
GetPropertiesContent ...
func (*MockClient) GetReleaseKey ¶
func (c *MockClient) GetReleaseKey(opts ...agollo.OpOption) string
GetReleaseKey ...
func (*MockClient) GetString ¶
func (c *MockClient) GetString(key string, opts ...agollo.OpOption) string
GetString ...
func (*MockClient) OnUpdate ¶
func (c *MockClient) OnUpdate(f func(*agollo.ChangeEvent))
OnUpdate ...
func (*MockClient) SubscribeToNamespaces ¶
func (c *MockClient) SubscribeToNamespaces(namespaces ...string) error
SubscribeToNamespaces ...
Click to show internal directories.
Click to hide internal directories.