oimregistry

package
v0.0.0-...-ee17956 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegistryEntries

func GetRegistryEntries(db RegistryDB) map[string]string

GetRegistryEntries returns all database entries as a map.

func RegistryClientContext

func RegistryClientContext(ctx context.Context, client string) context.Context

RegistryClientContext creates a new context with credentials as if the client had connected via TLS with the client name as CommonName.

Types

type Option

type Option func(r *registry) error

Option is the parameter type taken by New.

func DB

func DB(db RegistryDB) Option

DB sets the registry database backend.

func TLS

func TLS(tlsConfig *tls.Config) Option

TLS sets the TLS configuration (secret key, CA) for the OIM registry server.

type RegistryDB

type RegistryDB interface {
	// Store a new mapping. Empty address removes the entry.
	Store(controllerID, address string)

	// Lookup returns the endpoint or the empty string if not found.
	Lookup(controllerID string) (address string)

	// Foreach iterates over all DB entries until
	// the callback function returns false.
	Foreach(func(controllerID, address string) bool)
}

RegistryDB stores the mapping from controller ID to gRPC address of the controller.

func NewMemRegistryDB

func NewMemRegistryDB() RegistryDB

NewMemRegistryDB constructs a new in-memory database.

type RegistryServer

type RegistryServer interface {
	oim.RegistryServer

	// Server creates a server as required to run the registry service.
	Server(endpoint string) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))
}

RegistryServer is the public interface for managing a OIM registry server.

func New

func New(options ...Option) (RegistryServer, error)

New creates a new instance of the OIM registry.

Jump to

Keyboard shortcuts

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