Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterReader ¶
func RegisterReader(scheme Scheme, newReader func(uri string) (ConfReader, error)) error
RegisterReader registers a reader for given scheme
Types ¶
type ConfReader ¶
type ConfReader interface {
// Read reads configuration data
Read(ctx context.Context) ([]byte, error)
// Subscribe subscribes to configuration changes and returns update channel
Subscribe(ctx context.Context) (<-chan *ReadEvent, error)
// Close closes the reader and cleans up resources
Close() error
}
ConfReader defines configuration reader interface
func GetReader ¶
func GetReader(scheme Scheme, uri string) (ConfReader, error)
GetReader creates and returns reader for given scheme and URI
func NewReader ¶
func NewReader(uri string) (ConfReader, error)
NewReader creates reader from URI by detecting scheme automatically
type ReadEvent ¶
type ReadEvent struct {
SourceURI string `json:"source_uri"`
Timestamp time.Time `json:"timestamp"`
Data []byte `json:"data"`
Error error `json:"error,omitempty"`
}
ReadEvent represents configuration update event
func NewReadEvent ¶
NewReadEvent creates a new configuration event with validation
Click to show internal directories.
Click to hide internal directories.