client

package
v0.0.0-...-5c99f88 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client implementation of the Mesh Configuration Protocol (MCP). It is responsible for the following:

  • Maintaining the bidirectional grpc stream with the server. The stream will be reestablished on transient network failures. The provided grpc connection (mcpClient) is assumed to handle (re)dialing the server.
  • Handling all aspects of the MCP exchange for the supported message types, e.g. request/response, ACK/NACK, nonce, versioning,

- Decoding the received configuration updates and providing them to the user via a batched set of changes.

func New

func New(mcpClient mcp.AggregatedMeshConfigServiceClient, options *sink.Options) *Client

New creates a new instance of the MCP client for the specified message types.

func (*Client) Collections

func (c *Client) Collections() []string

Collections returns the collections that this client requests.

func (*Client) ID

func (c *Client) ID() string

ID is the node id for this client.

func (*Client) Metadata

func (c *Client) Metadata() map[string]string

Metadata that is originally supplied when creating this client.

func (*Client) Run

func (c *Client) Run(ctx context.Context)

Run starts the run loop for request and receiving configuration updates from the server. This function blocks and should typically be run in a goroutine. The client will continue to attempt to re-establish the stream with the server indefinitely. The function exits when the provided context is canceled.

func (*Client) SnapshotRequestInfo

func (c *Client) SnapshotRequestInfo() []sink.RecentRequestInfo

SnapshotRequestInfo returns a snapshot of the last known set of request results.

Jump to

Keyboard shortcuts

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