endpoint

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: Apache-2.0 Imports: 20 Imported by: 22

Documentation

Overview

Package endpoint provides a simple wrapper for building a NetworkServiceServer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, listenOn *url.URL, endpoint Endpoint, opt ...grpc.ServerOption) <-chan error

Serve - serves passed Endpoint on grpc

Types

type Endpoint

type Endpoint interface {
	networkservice.NetworkServiceServer
	networkservice.MonitorConnectionServer
	// Register - register the endpoint with *grpc.Server s
	Register(s *grpc.Server)
}

Endpoint - aggregates the APIs:

  • networkservice.NetworkServiceServer
  • networkservice.MonitorConnectionServer

func Combine added in v1.1.0

func Combine(combineFun func(servers []networkservice.NetworkServiceServer) networkservice.NetworkServiceServer, eps ...Endpoint) Endpoint

Combine returns a new combined endpoint: * networkservice.NetworkServiceServer created by combineFun(eps) * networkservice.MonitorConnectionServer part is managed in the following way:

  • networkservice.ConnectionEventType_INITIAL_STATE_TRANSFER is merged to single event from all endpoints
  • rest events just go with no changes from all endpoints

func NewServer

func NewServer(ctx context.Context, tokenGenerator token.GeneratorFunc, options ...Option) Endpoint

NewServer - returns a NetworkServiceMesh client as a chain of the standard Client pieces plus whatever

type Option

type Option func(o *serverOptions)

Option modifies server option value

func WithAdditionalFunctionality

func WithAdditionalFunctionality(additionalFunctionality ...networkservice.NetworkServiceServer) Option

WithAdditionalFunctionality sets additional NetworkServiceServer chain elements to be included in the chain

func WithAuthorizeServer

func WithAuthorizeServer(authorizeServer networkservice.NetworkServiceServer) Option

WithAuthorizeServer sets authorization server chain element

func WithName

func WithName(name string) Option

WithName sets name of the NetworkServiceServer

Jump to

Keyboard shortcuts

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