Documentation
¶
Overview ¶
Package polaris implements a config.Source backed by the Polaris config center (github.com/polarismesh/polaris-go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a Polaris config Source.
The addresses are applied to the *config* connector. This matters because NewDefaultConfiguration only writes global.serverConnector.addresses — the service-discovery connector — while config.configConnector.addresses carries its own default of 127.0.0.1:8093 (pkg/config/default.go DefaultConfigConnectorAddresses). Passing the addresses to NewDefaultConfiguration therefore configured discovery and left every config fetch pointed at localhost, which fails as a timeout that names no cause.
NewDefaultConfiguration(nil) is used rather than the WithDomain variant: the latter loads ./polaris.yaml from the working directory when one happens to exist, so the effective configuration would depend on where the process was started.
Types ¶
type Options ¶
type Options struct {
// Addresses are the Polaris config center addresses, e.g. ["10.0.0.1:8093"].
//
// These are the *config* connector's addresses. They are not the service
// discovery addresses (8091) the registry backend uses: a Polaris server
// listens for config on its own port, 8093 by default.
Addresses []string
// Namespace is the config file namespace.
Namespace string
// FileGroup is the config file group.
FileGroup string
// FileName is the config file name.
FileName string
// Format is the config file format; empty defaults to yaml.
Format string
// Token is the access token the config connector authenticates with. Empty
// means no token is sent, which is what a server without auth expects.
Token string
}
Options configures the Polaris config center Source.