Documentation ¶
Overview ¶
Package queue implements our email queue. Accepted envelopes get put in the queue, and processed asynchronously.
Index ¶
- Variables
- type Item
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetCreatedAtTs() *Timestamp
- func (x *Message) GetData() []byte
- func (x *Message) GetFrom() string
- func (x *Message) GetID() string
- func (x *Message) GetRcpt() []*Recipient
- func (x *Message) GetTo() []string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type Queue
- type Recipient
- func (*Recipient) Descriptor() ([]byte, []int)deprecated
- func (x *Recipient) GetAddress() string
- func (x *Recipient) GetLastFailureMessage() string
- func (x *Recipient) GetOriginalAddress() string
- func (x *Recipient) GetStatus() Recipient_Status
- func (x *Recipient) GetType() Recipient_Type
- func (*Recipient) ProtoMessage()
- func (x *Recipient) ProtoReflect() protoreflect.Message
- func (x *Recipient) Reset()
- func (x *Recipient) String() string
- type Recipient_Status
- func (Recipient_Status) Descriptor() protoreflect.EnumDescriptor
- func (x Recipient_Status) Enum() *Recipient_Status
- func (Recipient_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x Recipient_Status) Number() protoreflect.EnumNumber
- func (x Recipient_Status) String() string
- func (Recipient_Status) Type() protoreflect.EnumType
- type Recipient_Type
- func (Recipient_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Recipient_Type) Enum() *Recipient_Type
- func (Recipient_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Recipient_Type) Number() protoreflect.EnumNumber
- func (x Recipient_Type) String() string
- func (Recipient_Type) Type() protoreflect.EnumType
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
var ( Recipient_Type_name = map[int32]string{ 0: "EMAIL", 1: "PIPE", } Recipient_Type_value = map[string]int32{ "EMAIL": 0, "PIPE": 1, } )
Enum value maps for Recipient_Type.
var ( Recipient_Status_name = map[int32]string{ 0: "PENDING", 1: "SENT", 2: "FAILED", } Recipient_Status_value = map[string]int32{ "PENDING": 0, "SENT": 1, "FAILED": 2, } )
Enum value maps for Recipient_Status.
var File_queue_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { // Base the item on the protobuf message. // We will use this for serialization, so any fields below are NOT // serialized. Message // Protect the entire item. sync.Mutex // Go-friendly version of Message.CreatedAtTs. CreatedAt time.Time }
An Item in the queue.
func ItemFromFile ¶
ItemFromFile loads an item from the given file.
type Message ¶
type Message struct { // Message ID. Uniquely identifies this message, it is used for // auditing and troubleshooting. ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // The envelope for this message. From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` To []string `protobuf:"bytes,3,rep,name=To,proto3" json:"To,omitempty"` Rcpt []*Recipient `protobuf:"bytes,4,rep,name=rcpt,proto3" json:"rcpt,omitempty"` Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` // Creation timestamp. CreatedAtTs *Timestamp `protobuf:"bytes,6,opt,name=created_at_ts,json=createdAtTs,proto3" json:"created_at_ts,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetCreatedAtTs ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue that keeps mail waiting for delivery.
func New ¶
func New(path string, localDomains *set.String, aliases *aliases.Resolver, localC, remoteC courier.Courier) (*Queue, error)
New creates a new Queue instance.
func (*Queue) DumpString ¶
DumpString returns a human-readable string with the current queue. Useful for debugging purposes.
type Recipient ¶
type Recipient struct { // Address to send the message to. // This is the final one, after expanding aliases. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Type Recipient_Type `protobuf:"varint,2,opt,name=type,proto3,enum=queue.Recipient_Type" json:"type,omitempty"` Status Recipient_Status `protobuf:"varint,3,opt,name=status,proto3,enum=queue.Recipient_Status" json:"status,omitempty"` LastFailureMessage string `protobuf:"bytes,4,opt,name=last_failure_message,json=lastFailureMessage,proto3" json:"last_failure_message,omitempty"` // Address that this recipient was originally intended to. // This is before expanding aliases and only used in very particular // cases. OriginalAddress string `protobuf:"bytes,5,opt,name=original_address,json=originalAddress,proto3" json:"original_address,omitempty"` // contains filtered or unexported fields }
func (*Recipient) Descriptor
deprecated
func (*Recipient) GetAddress ¶
func (*Recipient) GetLastFailureMessage ¶
func (*Recipient) GetOriginalAddress ¶
func (*Recipient) GetStatus ¶
func (x *Recipient) GetStatus() Recipient_Status
func (*Recipient) GetType ¶
func (x *Recipient) GetType() Recipient_Type
func (*Recipient) ProtoMessage ¶
func (*Recipient) ProtoMessage()
func (*Recipient) ProtoReflect ¶
func (x *Recipient) ProtoReflect() protoreflect.Message
type Recipient_Status ¶
type Recipient_Status int32
const ( Recipient_PENDING Recipient_Status = 0 Recipient_SENT Recipient_Status = 1 Recipient_FAILED Recipient_Status = 2 )
func (Recipient_Status) Descriptor ¶
func (Recipient_Status) Descriptor() protoreflect.EnumDescriptor
func (Recipient_Status) Enum ¶
func (x Recipient_Status) Enum() *Recipient_Status
func (Recipient_Status) EnumDescriptor
deprecated
func (Recipient_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use Recipient_Status.Descriptor instead.
func (Recipient_Status) Number ¶
func (x Recipient_Status) Number() protoreflect.EnumNumber
func (Recipient_Status) String ¶
func (x Recipient_Status) String() string
func (Recipient_Status) Type ¶
func (Recipient_Status) Type() protoreflect.EnumType
type Recipient_Type ¶
type Recipient_Type int32
const ( Recipient_EMAIL Recipient_Type = 0 Recipient_PIPE Recipient_Type = 1 )
func (Recipient_Type) Descriptor ¶
func (Recipient_Type) Descriptor() protoreflect.EnumDescriptor
func (Recipient_Type) Enum ¶
func (x Recipient_Type) Enum() *Recipient_Type
func (Recipient_Type) EnumDescriptor
deprecated
func (Recipient_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Recipient_Type.Descriptor instead.
func (Recipient_Type) Number ¶
func (x Recipient_Type) Number() protoreflect.EnumNumber
func (Recipient_Type) String ¶
func (x Recipient_Type) String() string
func (Recipient_Type) Type ¶
func (Recipient_Type) Type() protoreflect.EnumType
type Timestamp ¶
type Timestamp struct { // Represents seconds of UTC time since Unix epoch. Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Non-negative fractions of a second at nanosecond resolution. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` // contains filtered or unexported fields }
Timestamp representation, for convenience. We used to use the well-known type, but the dependency makes packaging much more convoluted and adds very little value, so we now just include it here.
func (*Timestamp) Descriptor
deprecated
func (*Timestamp) GetSeconds ¶
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (*Timestamp) ProtoReflect ¶
func (x *Timestamp) ProtoReflect() protoreflect.Message