server

package
v0.0.0-...-d8a8f93 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelWatchFunc

type CancelWatchFunc func()

CancelWatchFunc allows the consumer to cancel a previous watch, terminating the watch for the request.

type Server

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

Server implements the Mesh Configuration Protocol (MCP) gRPC server.

func New

func New(watcher Watcher, supportedTypes []string) *Server

New creates a new gRPC server that implements the Mesh Configuration Protocol (MCP).

func (*Server) StreamAggregatedResources

func (s *Server) StreamAggregatedResources(stream mcp.AggregatedMeshConfigService_StreamAggregatedResourcesServer) error

StreamAggregatedResources implements bidirectional streaming method for MCP (ADS).

type WatchResponse

type WatchResponse struct {
	TypeURL string

	// Version of the resources in the response for the given
	// type. The client responses with this version in subsequent
	// requests as an acknowledgment.
	Version string

	// Enveloped resources to be included in the response.
	Envelopes []*mcp.Envelope
}

WatchResponse contains a versioned collection of pre-serialized resources.

type Watcher

type Watcher interface {
	// Watch returns a new open watch for a non-empty request.
	//
	// Immediate responses should be returned to the caller along
	// with an optional cancel function. Asynchronous responses should
	// be delivered through the write-only WatchResponse channel. If the
	// channel is closed prior to cancellation of the watch, an
	// unrecoverable error has occurred in the producer, and the consumer
	// should close the corresponding stream.
	//
	// Cancel is an optional function to release resources in the
	// producer. It can be called idempotently to cancel and release resources.
	Watch(*mcp.MeshConfigRequest, chan<- *WatchResponse) (*WatchResponse, CancelWatchFunc)
}

Watcher requests watches for configuration resources by node, last applied version, and type. The watch should send the responses when they are ready. The watch can be canceled by the consumer.

Jump to

Keyboard shortcuts

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