controlapi

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

View Source
const Hostname = "control.core"

Hostname is the default hostname of the microservice: control.core.

Variables

View Source
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 NewClient

func NewClient(caller service.Publisher) *Client

NewClient creates a new unicast client to the control.core microservice.

func (*Client) ConfigRefresh

func (_c *Client) ConfigRefresh(ctx context.Context) (err error)

ConfigRefresh pulls the latest config values from the configurator service.

func (*Client) ForHost

func (_c *Client) ForHost(host string) *Client

ForHost replaces the default hostname of this client.

func (*Client) Ping

func (_c *Client) Ping(ctx context.Context) (pong int, err error)

Ping responds to the message with a pong.

func (*Client) Trace

func (_c *Client) Trace(ctx context.Context, id string) (err error)

Trace forces exporting the indicated tracing span.

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 PingIn

type PingIn struct {
}

PingIn are the input arguments of Ping.

type PingOut

type PingOut struct {
	Pong int `json:"pong"`
}

PingOut are the return values of Ping.

type PingResponse

type PingResponse struct {
	HTTPResponse *http.Response
	// contains filtered or unexported fields
}

PingResponse is the response to Ping.

func (*PingResponse) Get

func (_out *PingResponse) Get() (pong int, err error)

Get retrieves the return values.

type ServiceInfo

type ServiceInfo struct {
	Hostname string
	Version  int
	ID       string
}

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 TraceOut

type TraceOut struct {
}

TraceOut are the return values of Trace.

type TraceResponse

type TraceResponse struct {
	HTTPResponse *http.Response
	// contains filtered or unexported fields
}

TraceResponse is the response to Trace.

func (*TraceResponse) Get

func (_out *TraceResponse) Get() (err error)

Get retrieves the return values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL