db

package
v0.0.0-...-7b59768 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Inbound   EnvelopeType   = 0
	Outbound                 = 1
	Pending   EnvelopeStatus = 0 //only meaningful if Type is Outbound
	Delivered                = 1
	Failed                   = 2 //DeliverTries exceeded maximum tries
	Assigned                 = 3
)

Variables

This section is empty.

Functions

func Close

func Close()

func MD5

func MD5(data []byte) []byte

func Open

func Open()

func Reopen

func Reopen()

func Stat

func Stat(username string) (int, int)

func UnassignAll

func UnassignAll(tx *bolt.Tx)

func UserBucket

func UserBucket(tx *bolt.Tx, user string) (*bolt.Bucket, error)

func Users

func Users() map[string]string

Types

type Envelope

type Envelope struct {
	Type            EnvelopeType
	Status          EnvelopeStatus //checked by outbound delivery agent during dispatch
	DeliverTries    int            //times the delivery agent has tried delivering the envelope
	NextDeliverTime time.Time      //checked periodically by outbound delivery agent
	ID              string         //<client session id>:<random string>
	Session         string
	OutboundAllowed bool //whether envelope is allowed to be delivered to external recipients
	Sender          string
	Recipients      []string
	Body            string
	Date            time.Time
	Deleted         bool
}

func List

func List(username string, showDeleted bool) []*Envelope

func Sweep

func Sweep() []*Envelope

func (*Envelope) Save

func (e *Envelope) Save() (string, error)

type EnvelopeStatus

type EnvelopeStatus uint8

type EnvelopeType

type EnvelopeType uint8

Jump to

Keyboard shortcuts

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