server: github.com/katzenpost/server/internal/provider/kaetzchen Index | Files

package kaetzchen

import "github.com/katzenpost/server/internal/provider/kaetzchen"

Package kaetzchen implements support for provider side auto-responder agents.

Package kaetzchen implements support for provider side auto-responder agents.

Index

Package Files

cbor_plugins.go kaetzchen.go keyserver.go loop.go

Constants

const LoopCapability = "loop"

LoopCapability is the standardized capability for the loop/discard service.

const ParameterEndpoint = "endpoint"

ParameterEndpoint is the mandatory Parameter key indicationg the Kaetzchen's endpoint.

Variables

var BuiltInCtors = map[string]BuiltInCtorFn{
    LoopCapability: NewLoop,
    // contains filtered or unexported fields
}

BuiltInCtors are the constructors for all built-in Kaetzchen.

var ErrNoResponse = errors.New("kaetzchen: message has no response")

ErrNoResponse is the error returned from OnMessage() when there is no response to be sent (rather than an empty response).

type BuiltInCtorFn Uses

type BuiltInCtorFn func(*config.Kaetzchen, glue.Glue) (Kaetzchen, error)

BuiltInCtorFn is the constructor type for a built-in Kaetzchen.

type CBORPluginWorker Uses

type CBORPluginWorker struct {
    sync.Mutex
    worker.Worker
    // contains filtered or unexported fields
}

CBORPluginWorker is similar to Kaetzchen worker but uses CBOR over HTTP over UNIX domain socket to talk to plugins.

func NewCBORPluginWorker Uses

func NewCBORPluginWorker(glue glue.Glue) (*CBORPluginWorker, error)

NewCBORPluginWorker returns a new CBORPluginWorker

func (*CBORPluginWorker) IsKaetzchen Uses

func (k *CBORPluginWorker) IsKaetzchen(recipient [sConstants.RecipientIDLength]byte) bool

IsKaetzchen returns true if the given recipient is one of our workers.

func (*CBORPluginWorker) KaetzchenForPKI Uses

func (k *CBORPluginWorker) KaetzchenForPKI() ServiceMap

KaetzchenForPKI returns the plugins Parameters map for publication in the PKI doc.

func (*CBORPluginWorker) OnKaetzchen Uses

func (k *CBORPluginWorker) OnKaetzchen(pkt *packet.Packet)

OnKaetzchen enqueues the pkt for processing by our thread pool of plugins.

type Kaetzchen Uses

type Kaetzchen interface {
    // Capability returns the agent's functionality for publication in
    // the Provider's descriptor.
    Capability() string

    // Parameters returns the agent's paramenters for publication in
    // the Provider's descriptor.
    Parameters() Parameters

    // OnRequest is the method that is called when the Provider receives
    // a request designed for a particular agent.  The caller will handle
    // extracting the payload component of the message.
    //
    // Implementations MUST:
    //
    //  * Be thread (go routine) safe.
    //
    //  * Return ErrNoResponse if there is no response to be sent.  A nil
    //    byte slice and nil error will result in a response with a 0 byte
    //    payload being sent.
    //
    //  * NOT assume payload will be valid past the call to OnMessage.
    //    Any contents that need to be preserved, MUST be copied out,
    //    except if it is only used as a part of the response body.
    OnRequest(id uint64, payload []byte, hasSURB bool) ([]byte, error)

    // Halt cleans up the agent prior to de-registration and teardown.
    Halt()
}

Kaetzchen is the interface implemented by each auto-responder agent.

func NewKeyserver Uses

func NewKeyserver(cfg *config.Kaetzchen, glue glue.Glue) (Kaetzchen, error)

NewKeyserver constructs a new Keyserver Kaetzchen instance, providing the "keyserver" capability on the configured endpoint.

func NewLoop Uses

func NewLoop(cfg *config.Kaetzchen, glue glue.Glue) (Kaetzchen, error)

NewLoop constructs a new Loop Kaetzchen instance, providing the "loop" capability, on the configured endpoint.

type KaetzchenWorker Uses

type KaetzchenWorker struct {
    sync.Mutex
    worker.Worker
    // contains filtered or unexported fields
}

func New Uses

func New(glue glue.Glue) (*KaetzchenWorker, error)

func (*KaetzchenWorker) IsKaetzchen Uses

func (k *KaetzchenWorker) IsKaetzchen(recipient [sConstants.RecipientIDLength]byte) bool

func (*KaetzchenWorker) KaetzchenForPKI Uses

func (k *KaetzchenWorker) KaetzchenForPKI() map[string]map[string]interface{}

func (*KaetzchenWorker) OnKaetzchen Uses

func (k *KaetzchenWorker) OnKaetzchen(pkt *packet.Packet)

type Parameters Uses

type Parameters map[string]interface{}

Parameters is the map describing each Kaetzchen's parameters to be published in the Provider's descriptor.

type PluginChans Uses

type PluginChans = map[[sConstants.RecipientIDLength]byte]*channels.InfiniteChannel

PluginChans maps from Recipient ID to channel.

type PluginName Uses

type PluginName = string

PluginName is the name of a plugin.

type PluginParameters Uses

type PluginParameters = map[PluginName]interface{}

PluginParameters maps from parameter key to value.

type ServiceMap Uses

type ServiceMap = map[PluginName]PluginParameters

ServiceMap maps from plugin name to plugin parameters and is used by Mix Descriptors which describe Providers with plugins. Each plugin can optionally set one or more parameters.

Package kaetzchen imports 18 packages (graph) and is imported by 2 packages. Updated 2019-10-09. Refresh now. Tools for package owners.