Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Checks to see if the Configuration service contains the service's configuration.
HasConfiguration() (bool, error)
// Puts a full toml configuration into the Configuration service
PutConfigurationToml(configuration *toml.Tree, overwrite bool) error
// Puts a full configuration struct into the Configuration service
PutConfiguration(configStruct interface{}, overwrite bool) error
// Gets the full configuration from Consul into the target configuration struct.
// Passed in struct is only a reference for Configuration service. Empty struct is fine
// Returns the configuration in the target struct as interface{}, which caller must cast
GetConfiguration(configStruct interface{}) (interface{}, error)
// Sets up a Consul watch for the target key and send back updates on the update channel.
// Passed in struct is only a reference for Configuration service, empty struct is ok
// Sends the configuration in the target struct as interface{} on updateChannel, which caller must cast
WatchForChanges(updateChannel chan<- interface{}, errorChannel chan<- error, configuration interface{}, waitKey string)
// Simply checks if Configuration service is up and running at the configured URL
IsAlive() bool
// Checks if a configuration value exists in the Configuration service
ConfigurationValueExists(name string) (bool, error)
// Gets a specific configuration value from the Configuration service
GetConfigurationValue(name string) ([]byte, error)
// Puts a specific configuration value into the Configuration service
PutConfigurationValue(name string, value []byte) error
}
func NewConfigurationClient ¶
func NewConfigurationClient(config types.ServiceConfig) (Client, error)
Click to show internal directories.
Click to hide internal directories.