apollo

package
v1.19.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package apollo implements Store for reading and watching configurations from Apollo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableWatch

func EnableWatch() option

EnableWatch enables watching configuration changes

func New

func New(opts ...option) store.Store

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 WithAccessKey

func WithAccessKey(ak string) option

WithAccessKey sets Apollo Access Key

func WithAppID

func WithAppID(id string) option

WithAppID sets AppID to read configurations from

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

func WithURL

func WithURL(url string) option

WithURL sets Apollo URL

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL