Documentation
¶
Overview ¶
Package configuratorapi implements the public API of the configurator.core microservice, including clients and data structures.
The Configurator is a core microservice that centralizes the dissemination of configuration values to other microservices.
Index ¶
- Constants
- Variables
- type Client
- func (_c *Client) ForHost(host string) *Client
- func (_c *Client) Refresh(ctx context.Context) (err error)
- func (_c *Client) Sync(ctx context.Context, timestamp time.Time, values map[string]map[string]string) (err error)
- func (_c *Client) Values(ctx context.Context, names []string) (values map[string]string, err error)
- type MulticastClient
- func (_c *MulticastClient) ForHost(host string) *MulticastClient
- func (_c *MulticastClient) Refresh(ctx context.Context) <-chan *RefreshResponse
- func (_c *MulticastClient) Sync(ctx context.Context, timestamp time.Time, values map[string]map[string]string) <-chan *SyncResponse
- func (_c *MulticastClient) Values(ctx context.Context, names []string) <-chan *ValuesResponse
- type RefreshIn
- type RefreshOut
- type RefreshResponse
- type SyncIn
- type SyncOut
- type SyncResponse
- type ValuesIn
- type ValuesOut
- type ValuesResponse
Constants ¶
const Hostname = "configurator.core"
Hostname is the default hostname of the microservice: configurator.core.
Variables ¶
var ( URLOfValues = httpx.JoinHostAndPath(Hostname, `:443/values`) URLOfRefresh = httpx.JoinHostAndPath(Hostname, `:443/refresh`) URLOfSync = httpx.JoinHostAndPath(Hostname, `:443/sync`) )
Fully-qualified URLs of the microservice's endpoints.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an interface to calling the endpoints of the configurator.core microservice. This simple version is for unicast calls.
func (*Client) Refresh ¶
Refresh tells all microservices to contact the configurator and refresh their configs. An error is returned if any of the values sent to the microservices fails validation.
type MulticastClient ¶
type MulticastClient struct {
// contains filtered or unexported fields
}
MulticastClient is an interface to calling the endpoints of the configurator.core microservice. This advanced version is for multicast calls.
func NewMulticastClient ¶
func NewMulticastClient(caller service.Publisher) *MulticastClient
NewMulticastClient creates a new multicast client to the configurator.core microservice.
func (*MulticastClient) ForHost ¶
func (_c *MulticastClient) ForHost(host string) *MulticastClient
ForHost replaces the default hostname of this client.
func (*MulticastClient) Refresh ¶
func (_c *MulticastClient) Refresh(ctx context.Context) <-chan *RefreshResponse
Refresh tells all microservices to contact the configurator and refresh their configs. An error is returned if any of the values sent to the microservices fails validation.
func (*MulticastClient) Sync ¶
func (_c *MulticastClient) Sync(ctx context.Context, timestamp time.Time, values map[string]map[string]string) <-chan *SyncResponse
Sync is used to synchronize values among replica peers of the configurator.
func (*MulticastClient) Values ¶
func (_c *MulticastClient) Values(ctx context.Context, names []string) <-chan *ValuesResponse
Values returns the values associated with the specified config property names for the caller microservice.
type RefreshResponse ¶
type RefreshResponse struct { HTTPResponse *http.Response // contains filtered or unexported fields }
RefreshResponse is the response to Refresh.
func (*RefreshResponse) Get ¶
func (_out *RefreshResponse) Get() (err error)
Get retrieves the return values.
type SyncIn ¶
type SyncIn struct { Timestamp time.Time `json:"timestamp"` Values map[string]map[string]string `json:"values"` }
SyncIn are the input arguments of Sync.
type SyncResponse ¶
SyncResponse is the response to Sync.
func (*SyncResponse) Get ¶
func (_out *SyncResponse) Get() (err error)
Get retrieves the return values.
type ValuesIn ¶
type ValuesIn struct {
Names []string `json:"names"`
}
ValuesIn are the input arguments of Values.
type ValuesResponse ¶
type ValuesResponse struct { HTTPResponse *http.Response // contains filtered or unexported fields }
ValuesResponse is the response to Values.