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 ¶
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 ¶
func (st *MeshStorageDriver) Lookup(ctx context.Context, req LookupRequest) (*v1.LookupResponse, error)
Lookup is the registrar Lookup 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 (*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.
Click to show internal directories.
Click to hide internal directories.