registrar

package
v0.14.9 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented    = status.Error(codes.Unimplemented, "method not implemensted")
	ErrAliasExists       = status.Error(codes.AlreadyExists, "alias already exists")
	ErrAliasNotFound     = status.Error(codes.NotFound, "alias not found")
	ErrPublicKeyNotFound = status.Error(codes.NotFound, "public key not found")
	ErrIDNotFound        = status.Error(codes.NotFound, "id not found")
)

Common errors.

View Source
var (
	IDPrefix    = []byte("/registrar/id/")
	AliasPrefix = []byte("/registrar/alias/")
)

Functions

This section is empty.

Types

type LookupRequest

type LookupRequest struct {
	Alias string
	ID    string
	Key   crypto.PublicKey
}

LookupRequest is a parsed lookup request from the registrar.

type MeshStorageDriver

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

MeshStorageDriver is a storage driver that uses the underlying mesh storage.

func (*MeshStorageDriver) Lookup

Lookup is the registrar Lookup RPC.

func (*MeshStorageDriver) Register

func (st *MeshStorageDriver) Register(ctx context.Context, key crypto.PublicKey, alias string, validUntil time.Time) (*v1.RegisterResponse, error)

Register is the registrar Register RPC.

type Options

type Options struct {
	// StorageDriver is the storage driver to use.
	StorageDriver StorageDriver
	// IDAuth is the configuration for ID authentication if
	// not already configured on the gRPC server.
	IDAuth *idauth.Config
	// PublicLookup is true if the registrar should be publicly
	// available for lookups.
	PublicLookup bool
}

Options are options for configuring the registrar server.

type Server

type Server struct {
	v1.UnimplementedRegistrarServer
	// contains filtered or unexported fields
}

Server is the registrar service.

func NewServer

func NewServer(ctx context.Context, opts Options) (*Server, error)

NewServer returns a new registrar server.

func (*Server) Lookup

func (srv *Server) Lookup(ctx context.Context, req *v1.LookupRequest) (*v1.LookupResponse, error)

Lookup is the registrar Lookup RPC.

func (*Server) Register

func (srv *Server) Register(ctx context.Context, req *v1.RegisterRequest) (*v1.RegisterResponse, error)

Register is the registrar Register RPC.

type StorageDriver

type StorageDriver interface {
	Register(ctx context.Context, key crypto.PublicKey, alias string, validUntil time.Time) (*v1.RegisterResponse, error)
	Lookup(ctx context.Context, req LookupRequest) (*v1.LookupResponse, error)
}

StorageDriver is a storage driver for the registrar.

func NewMeshStorageDriver

func NewMeshStorageDriver(st storage.MeshStorage) StorageDriver

NewMeshStorageDriver returns a new mesh storage driver.

Jump to

Keyboard shortcuts

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