registry

package
v0.0.0-...-c924774 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidKeyProviderError

type InvalidKeyProviderError struct {
	KeyProvider keyprovider.Descriptor
	Cause       error
}

InvalidKeyProviderError indicates that the supplied keyprovider.Descriptor is invalid/misbehaving. Check the error message for details.

func (InvalidKeyProviderError) Error

func (k InvalidKeyProviderError) Error() string

func (InvalidKeyProviderError) Unwrap

func (k InvalidKeyProviderError) Unwrap() error

type InvalidMethodError

type InvalidMethodError struct {
	Method method.Descriptor
	Cause  error
}

InvalidMethodError indicates that the supplied method.Descriptor is invalid/misbehaving. Check the error message for details.

func (InvalidMethodError) Error

func (k InvalidMethodError) Error() string

func (InvalidMethodError) Unwrap

func (k InvalidMethodError) Unwrap() error

type KeyProviderAlreadyRegisteredError

type KeyProviderAlreadyRegisteredError struct {
	ID               keyprovider.ID
	CurrentProvider  keyprovider.Descriptor
	PreviousProvider keyprovider.Descriptor
}

KeyProviderAlreadyRegisteredError indicates that the requested key provider was already registered in the registry.

func (KeyProviderAlreadyRegisteredError) Error

type KeyProviderNotFoundError

type KeyProviderNotFoundError struct {
	ID keyprovider.ID
}

KeyProviderNotFoundError indicates that the requested key provider was not found in the registry.

func (KeyProviderNotFoundError) Error

func (k KeyProviderNotFoundError) Error() string

type MethodAlreadyRegisteredError

type MethodAlreadyRegisteredError struct {
	ID             method.ID
	CurrentMethod  method.Descriptor
	PreviousMethod method.Descriptor
}

MethodAlreadyRegisteredError indicates that the requested encryption method was already registered in the registry.

func (MethodAlreadyRegisteredError) Error

type MethodNotFoundError

type MethodNotFoundError struct {
	ID method.ID
}

MethodNotFoundError indicates that the requested encryption method was not found in the registry.

func (MethodNotFoundError) Error

func (m MethodNotFoundError) Error() string

type Registry

type Registry interface {
	// RegisterKeyProvider registers a key provider. Use the keyprovider.Any().
	// This function returns a *KeyProviderAlreadyRegisteredError error if a key provider with the
	// same ID is already registered.
	RegisterKeyProvider(keyProvider keyprovider.Descriptor) error
	// RegisterMethod registers an encryption method. Use the method.Any() function to convert your method into a
	// suitable format. This function returns a *MethodAlreadyRegisteredError error if a key provider with the same ID is
	// already registered.
	RegisterMethod(method method.Descriptor) error

	// GetKeyProviderDescriptor returns the key provider with the specified ID. If the key provider is not registered,
	// it will return a *KeyProviderNotFoundError error.
	GetKeyProviderDescriptor(id keyprovider.ID) (keyprovider.Descriptor, error)

	// GetMethodDescriptor returns the method with the specified ID.
	// If the method is not registered, it will return a *MethodNotFoundError.
	GetMethodDescriptor(id method.ID) (method.Descriptor, error)
}

Registry collects all encryption methods and key providers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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