Documentation
¶
Overview ¶
Package target has utility functions for working with target configuration proto messages in target.proto.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(config *pb.Configuration) error
Validate confirms that the configuration is valid.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config handles configuration file changes and contains configuration state.
func NewConfigWithBase ¶
func NewConfigWithBase(h Handler, config *pb.Configuration) (*Config, error)
NewConfigWithBase creates a new Config that can process configuration changes. An optional configuration is used as the initial state.
func (*Config) Current ¶
func (c *Config) Current() *pb.Configuration
Current returns a copy of the current configuration.
type Handler ¶
type Handler struct {
// Add handles addition of a new target.
Add func(Update)
// Update handles target modification, including subscription request changes.
Update func(Update)
// Delete handles a target being removed.
Delete func(name string)
}
Handler defines callbacks to be synchronously invoked in response to configuration changes.
Click to show internal directories.
Click to hide internal directories.