grpc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package grpc provides a gRPC implementation of the Envoy v2 xDS API.

Index

Constants

View Source
const (
	EndpointType = typePrefix + "ClusterLoadAssignment"
	ClusterType  = typePrefix + "Cluster"
	RouteType    = typePrefix + "RouteConfiguration"
	ListenerType = typePrefix + "Listener"
)

Resource types in xDS v2.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(l log.Logger, t *contour.Translator) *grpc.Server

NewAPI returns a *grpc.Server which responds to the Envoy v2 xDS gRPC API.

Types

type CDS

type CDS struct {
	log.Logger
	ClusterCache
	// contains filtered or unexported fields
}

CDS implements the CDS v2 gRPC API.

func (*CDS) FetchClusters

func (c *CDS) FetchClusters(context.Context, *v2.DiscoveryRequest) (*v2.DiscoveryResponse, error)

func (*CDS) Resources

func (c *CDS) Resources() ([]*types.Any, error)

Resources returns the contents of CDS"s cache as a []*types.Any. TODO(dfc) cache the results of Resources in the ClusterCache so we can avoid the error handling.

func (*CDS) StreamClusters

func (c *CDS) StreamClusters(srv v2.ClusterDiscoveryService_StreamClustersServer) (err1 error)

func (*CDS) TypeURL

func (c *CDS) TypeURL() string

type ClusterCache

type ClusterCache interface {
	// Values returns a copy of the contents of the cache.
	// The slice and its contents should be treated as read-only.
	Values() []*v2.Cluster

	// Register registers ch to receive a value when Notify is called.
	Register(chan int, int)
}

ClusterCache holds a set of computed v2.Cluster resources.

type ClusterLoadAssignmentCache

type ClusterLoadAssignmentCache interface {
	// Values returns a copy of the contents of the cache.
	// The slice and its contents should be treated as read-only.
	Values() []*v2.ClusterLoadAssignment

	// Register registers ch to receive a value when Notify is called.
	Register(chan int, int)
}

ClusterLoadAssignmentCache holds a set of computed v2.ClusterLoadAssignment resources.

type EDS

type EDS struct {
	log.Logger
	ClusterLoadAssignmentCache
	// contains filtered or unexported fields
}

EDS implements the EDS v2 gRPC API.

func (*EDS) FetchEndpoints

func (e *EDS) FetchEndpoints(context.Context, *v2.DiscoveryRequest) (*v2.DiscoveryResponse, error)

func (*EDS) Resources

func (e *EDS) Resources() ([]*types.Any, error)

Resources returns the contents of EDS"s cache as a []*types.Any. TODO(dfc) cache the results of Resources in the ClusterLoadAssignmentCache so we can avoid the error handling.

func (*EDS) StreamEndpoints

func (e *EDS) StreamEndpoints(srv v2.EndpointDiscoveryService_StreamEndpointsServer) (err1 error)

func (*EDS) StreamLoadStats

func (*EDS) TypeURL

func (e *EDS) TypeURL() string

type LDS

type LDS struct {
	log.Logger
	ListenerCache
	// contains filtered or unexported fields
}

LDS implements the LDS v2 gRPC API.

func (*LDS) FetchListeners

func (l *LDS) FetchListeners(ctx context.Context, req *v2.DiscoveryRequest) (*v2.DiscoveryResponse, error)

func (*LDS) Resources

func (l *LDS) Resources() ([]*types.Any, error)

Resources returns the contents of LDS"s cache as a []*types.Any. TODO(dfc) cache the results of Resources in the ListenerCache so we can avoid the error handling.

func (*LDS) StreamListeners

func (l *LDS) StreamListeners(srv v2.ListenerDiscoveryService_StreamListenersServer) (err1 error)

func (*LDS) TypeURL

func (l *LDS) TypeURL() string

type ListenerCache

type ListenerCache interface {
	// Values returns a copy of the contents of the cache.
	// The slice and its contents should be treated as read-only.
	Values() []*v2.Listener

	// Register registers ch to receive a value when Notify is called.
	Register(chan int, int)
}

ListenerCache holds a set of computed v2.Listener resources.

type RDS

type RDS struct {
	log.Logger
	HTTP, HTTPS values
	*contour.Cond
	// contains filtered or unexported fields
}

RDS implements the RDS v2 gRPC API.

func (*RDS) FetchRoutes

func (*RDS) Resources

func (r *RDS) Resources() ([]*types.Any, error)

Resources returns the contents of RDS"s cache as a []*types.Any. TODO(dfc) cache the results of Resources in the VirtualHostCache so we can avoid the error handling.

func (*RDS) StreamRoutes

func (r *RDS) StreamRoutes(srv v2.RouteDiscoveryService_StreamRoutesServer) (err1 error)

func (*RDS) TypeURL

func (r *RDS) TypeURL() string

Jump to

Keyboard shortcuts

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