Documentation ¶
Overview ¶
Package rest defines the REST connection source creation strategy to be integrated into the config package source factory instance.
Index ¶
Constants ¶
const ( // ID defines the application container registration string for the // rest source creation strategy. ID = source.ID + ".rest" // ObsID defines the application container registration string for the // observable rest source creation strategy. ObsID = ID + "-observable" )
const ( // ObsType defines the value to be used to // declare an observable rest config source type. ObsType = "observable-rest" )
const ( // Type defines the value to be used to declare a // rest config source type. Type = "rest" )
Variables ¶
var ( // ErrConfigNotFound defines a rest response // config not found error. ErrConfigNotFound = fmt.Errorf("rest config source config not found") // ErrTimestampNotFound defines a rest response // timestamp not found error. ErrTimestampNotFound = fmt.Errorf("rest config source timestamp not found") )
Functions ¶
This section is empty.
Types ¶
type ObsSource ¶
type ObsSource struct { Source // contains filtered or unexported fields }
ObsSource defines a config source that read a REST service and store a section of the response as the stored config. Also, the REST service will be periodically checked for updates.
func NewObsSource ¶
func NewObsSource( client requester, uri, format string, decoderCreator decoderCreator, timestampPath, configPath string, ) (*ObsSource, error)
NewObsSource will instantiate a new configuration source that will read a REST endpoint for configuration info, opening the possibility for on-the-fly update on source content change.
type ObsSourceStrategy ¶
type ObsSourceStrategy struct {
SourceStrategy
}
ObsSourceStrategy defines a strategy used to instantiate an observable REST service config source creation strategy.
func NewObsSourceStrategy ¶
func NewObsSourceStrategy( decoderFactory *config.DecoderFactory, ) (*ObsSourceStrategy, error)
NewObsSourceStrategy instantiates a new observable REST service config source creation strategy.
type Provider ¶
type Provider struct{}
Provider defines the slate.config module service provider to be used on the application initialization to register the config service.
type Source ¶
Source defines a config source that read a REST service and store a section of the response as the stored config.
type SourceStrategy ¶
type SourceStrategy struct {
// contains filtered or unexported fields
}
SourceStrategy defines a strategy used to instantiate a REST service config source creation strategy.
func NewSourceStrategy ¶
func NewSourceStrategy( decoderFactory *config.DecoderFactory, ) (*SourceStrategy, error)
NewSourceStrategy instantiates a new REST service config source creation strategy.