mailproxy: github.com/katzenpost/mailproxy/event Index | Files

package event

import "github.com/katzenpost/mailproxy/event"

Package event implements the event types returned by the API's event listener.

Index

Package Files

event.go

Variables

var (
    // ErrInvalidReply is the error returned when a SURB reply payload is
    // malformed or otherwise invalid.
    ErrInvalidReply = errors.New("reply body is malformed")

    // ErrSendTimeout is the error returned when a message timed out before
    // being fully sent.
    ErrSendTimeout = errors.New("timed out attempting to send")

    // ErrReplyTimeout is the error returned when a Kaetzchen request timed
    // out waiting for a reply.
    ErrReplyTimeout = errors.New("timed out waiting for reply")
)

type ConnectionStatusEvent Uses

type ConnectionStatusEvent struct {
    // AccountID is the account identifier for the account associated with
    // the event.
    AccountID string

    // IsConnected is true iff the account is connected to the provider.
    IsConnected bool

    // Err is the error encountered when connecting or by the connection if any.
    Err error
}

ConnectionStatusEvent is the event sent when an account's connection status changes.

func (*ConnectionStatusEvent) String Uses

func (e *ConnectionStatusEvent) String() string

String returns a string representation of the ConnectionStatusEvent.

type Event Uses

type Event interface {
    // String returns a string representation of the Event.
    String() string
}

Event is the generic event sent over the event listener channel.

type KaetzchenReplyEvent Uses

type KaetzchenReplyEvent struct {
    // AccountID is the account identifier for the account associated with the
    // event.
    AccountID string

    // MessageID is the unique identifier for the request associated with the
    // reply.
    MessageID []byte

    // Payload is the reply payload if any.
    Payload []byte

    // Err is the error encountered when servicing the request if any.
    Err error
}

KaetzchenReplyEvent is the event sent when a Kaetzchen request completes.

func (*KaetzchenReplyEvent) String Uses

func (e *KaetzchenReplyEvent) String() string

String returns a string representation of the KaetzchenReplyEvent.

type MessageReceivedEvent Uses

type MessageReceivedEvent struct {
    // AccountID is the account identifier for the account associated with
    // the event.
    AccountID string

    // SenderKey is the message sender's public key, if any.
    SenderKey *ecdh.PublicKey

    // MessageID is the local unique identifier for the message.
    MessageID []byte
}

MessageReceivedEvent is the event sent when a new message is received.

func (*MessageReceivedEvent) String Uses

func (e *MessageReceivedEvent) String() string

String returns a string representation of the MessageReceivedEvent.

type MessageSentEvent Uses

type MessageSentEvent struct {
    // AccountID is the account identifier for the account associated with
    // the event.
    AccountID string

    // MessageID is the local unique identifier for the message, generated
    // when the message was enqueued.
    MessageID []byte

    // Err is the error encountered when sending the message if any.
    Err error
}

MessageSentEvent is the event sent when a message has been fully transmitted.

func (*MessageSentEvent) String Uses

func (e *MessageSentEvent) String() string

String returns a string representation of a MessageSentEvent.

Package event imports 4 packages (graph) and is imported by 7 packages. Updated 2018-06-09. Refresh now. Tools for package owners.