Documentation ¶
Overview ¶
Package controlapi implements the public API of the control.core microservice, including clients and data structures.
This microservice is created for the sake of generating the client API for the :888 control subscriptions. The microservice itself does nothing and should not be included in applications.
Package controlapi implements the public API of the control.core microservice, including clients and data structures.
This microservice is created for the sake of generating the client API for the :888 control subscriptions. The microservice itself does nothing and should not be included in applications.
Index ¶
- Constants
- Variables
- type Client
- type ConfigRefreshIn
- type ConfigRefreshOut
- type ConfigRefreshResponse
- type MulticastClient
- func (_c *MulticastClient) ConfigRefresh(ctx context.Context) <-chan *ConfigRefreshResponse
- func (_c *MulticastClient) ForHost(host string) *MulticastClient
- func (_c *MulticastClient) Ping(ctx context.Context) <-chan *PingResponse
- func (_c *MulticastClient) PingInstances(ctx context.Context) <-chan *ServiceInfo
- func (_c *MulticastClient) PingServices(ctx context.Context) <-chan *ServiceInfo
- func (_c *MulticastClient) PingVersions(ctx context.Context) <-chan *ServiceInfo
- func (_c *MulticastClient) Trace(ctx context.Context, id string) <-chan *TraceResponse
- type PingIn
- type PingOut
- type PingResponse
- type ServiceInfo
- type TraceIn
- type TraceOut
- type TraceResponse
Constants ¶
const Hostname = "control.core"
Hostname is the default hostname of the microservice: control.core.
Variables ¶
var ( URLOfPing = httpx.JoinHostAndPath(Hostname, `:888/ping`) URLOfConfigRefresh = httpx.JoinHostAndPath(Hostname, `:888/config-refresh`) URLOfTrace = httpx.JoinHostAndPath(Hostname, `:888/trace`) )
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 control.core microservice. This simple version is for unicast calls.
func (*Client) ConfigRefresh ¶
ConfigRefresh pulls the latest config values from the configurator service.
type ConfigRefreshIn ¶
type ConfigRefreshIn struct { }
ConfigRefreshIn are the input arguments of ConfigRefresh.
type ConfigRefreshOut ¶
type ConfigRefreshOut struct { }
ConfigRefreshOut are the return values of ConfigRefresh.
type ConfigRefreshResponse ¶
type ConfigRefreshResponse struct { HTTPResponse *http.Response // contains filtered or unexported fields }
ConfigRefreshResponse is the response to ConfigRefresh.
func (*ConfigRefreshResponse) Get ¶
func (_out *ConfigRefreshResponse) Get() (err error)
Get retrieves the return values.
type MulticastClient ¶
type MulticastClient struct {
// contains filtered or unexported fields
}
MulticastClient is an interface to calling the endpoints of the control.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 control.core microservice.
func (*MulticastClient) ConfigRefresh ¶
func (_c *MulticastClient) ConfigRefresh(ctx context.Context) <-chan *ConfigRefreshResponse
ConfigRefresh pulls the latest config values from the configurator service.
func (*MulticastClient) ForHost ¶
func (_c *MulticastClient) ForHost(host string) *MulticastClient
ForHost replaces the default hostname of this client.
func (*MulticastClient) Ping ¶
func (_c *MulticastClient) Ping(ctx context.Context) <-chan *PingResponse
Ping responds to the message with a pong.
func (*MulticastClient) PingInstances ¶
func (_c *MulticastClient) PingInstances(ctx context.Context) <-chan *ServiceInfo
PingInstances performs a ping and returns service info for all instances on the network.
func (*MulticastClient) PingServices ¶
func (_c *MulticastClient) PingServices(ctx context.Context) <-chan *ServiceInfo
PingServices performs a ping and returns service info for microservices on the network. Results are deduped on a per-service basis.
func (*MulticastClient) PingVersions ¶
func (_c *MulticastClient) PingVersions(ctx context.Context) <-chan *ServiceInfo
PingVersions performs a ping and returns service info for microservice versions on the network. Results are deduped on a per-version basis.
func (*MulticastClient) Trace ¶
func (_c *MulticastClient) Trace(ctx context.Context, id string) <-chan *TraceResponse
Trace forces exporting the indicated tracing span.
type PingOut ¶
type PingOut struct {
Pong int `json:"pong"`
}
PingOut are the return values of Ping.
type PingResponse ¶
PingResponse is the response to Ping.
func (*PingResponse) Get ¶
func (_out *PingResponse) Get() (pong int, err error)
Get retrieves the return values.
type ServiceInfo ¶
ServiceInfo is a descriptor of the microservice that answers the ping.
type TraceIn ¶
type TraceIn struct {
ID string `json:"id"`
}
TraceIn are the input arguments of Trace.
type TraceResponse ¶
TraceResponse is the response to Trace.
func (*TraceResponse) Get ¶
func (_out *TraceResponse) Get() (err error)
Get retrieves the return values.