Documentation ¶
Overview ¶
Package apollo implements Store for reading and watching configurations from Apollo.
Index ¶
- func EnableWatch() option
- func New(opts ...option) store.Store
- func NewLocalConfig(o ...localOption) (*localConfig, error)
- func WithAccessKey(ak string) option
- func WithAppID(id string) option
- func WithCluster(cluster string) option
- func WithLocalConfig(cfg *localConfig) option
- func WithLocalConfigPath(path string) localOption
- func WithNamespaces(namespaces ...string) option
- func WithTemplateData(tData tdata.TemplateData) option
- func WithURL(url string) option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a Store object for reading and watching configurations from Apollo. Unspecified Apollo client options could be read from ENV.
Relations of Apollo client options and ENV keys: - URL: APOLLO_META . It not found in ENV, default is http://apollo.meta - AppID: APOLLO_APP_ID - Cluster: APOLLO_CLUSTER . It not found in ENV, default is `default` - AccessKey: APOLLO_ACCESS_KEY , if not found, then APOLLO_ACCESSKEY_SECRET - Namespaces: APOLLO_NAMESPACE . Comma separated. For example: ns1,ns2,ns3. It not found in ENV, default is `application`
func NewLocalConfig ¶
func NewLocalConfig(o ...localOption) (*localConfig, error)
NewLocalConfig creates a LocalConfig object to read Apollo Access Key from. Configurations from LocalConfig will also be used to override configurations from Apollo
func WithCluster ¶
func WithCluster(cluster string) option
WithCluster sets Cluster to read configurations from
func WithLocalConfig ¶
func WithLocalConfig(cfg *localConfig) option
WithLocalConfig sets LocalConfig to read Apollo Access Key from. Will also use configurations from LocalConfig to override configurations read from Apollo
func WithLocalConfigPath ¶
func WithLocalConfigPath(path string) localOption
WithLocalConfigPath sets path to the local configuration file. Default is `configs.yaml`
func WithNamespaces ¶
func WithNamespaces(namespaces ...string) option
WithNamespaces sets namespaces to read configurations from
func WithTemplateData ¶
func WithTemplateData(tData tdata.TemplateData) option
WithTemplateData sets template data source. Will use configurations from `tData` to replace templates in the configurations read from Apollo
Types ¶
This section is empty.