osm

package
v0.0.0-...-4b75dde Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateClient

ValidateClient ensures that the connected client is authorized to connect to the gRPC server.

Types

type ControlPlane

type ControlPlane[T any] struct {
	// contains filtered or unexported fields
}

ControlPlane is the central part of OSM, that ties in config generation, proxy updates, the message broker, and throttling via the workerpool.

func NewControlPlane

func NewControlPlane[T any](server ProxyUpdater[T],
	generator ProxyConfigGenerator[T],
	catalog catalog.MeshCataloger,
	proxyRegistry *registry.ProxyRegistry,
	certManager *certificate.Manager,
	msgBroker *messaging.Broker,
) *ControlPlane[T]

NewControlPlane creates a new instance of ControlPlane with the given config type T.

func (*ControlPlane[T]) ProxyConnected

func (cp *ControlPlane[T]) ProxyConnected(ctx context.Context, connectionID int64) error

ProxyConnected is called on stream open

func (*ControlPlane[T]) ProxyDisconnected

func (cp *ControlPlane[T]) ProxyDisconnected(connectionID int64)

ProxyDisconnected is called on stream closed

type ProxyConfigGenerator

type ProxyConfigGenerator[T any] interface {
	GenerateConfig(context.Context, *models.Proxy) (T, error)
}

ProxyConfigGenerator is an abstraction over a type that generates a Config of type `T` for the proxy passed in the GenerateConfig method. It is not meant to actually update the proxy itself.

type ProxyUpdater

type ProxyUpdater[T any] interface {
	UpdateProxy(context.Context, *models.Proxy, T) error
}

ProxyUpdater is an abstraction over a type that updates a proxy with a Config of type `T` to the proxy passed in the UpdateProxy method.

Jump to

Keyboard shortcuts

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