Documentation
¶
Overview ¶
Package webfist implements WebFist.
Index ¶
Constants ¶
const MaxEmailSize = 64 << 10
MaxEmailSize is the maxium size of an RFC 822 email, including both its headers and body.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
Email wraps a signed email.
func NewEmail ¶
NewEmail parses all as an email and returns a wrapper around it. Its size and format is done, but no signing verification is done.
func (*Email) SetEncSHA1 ¶
type EmailAddr ¶
type EmailAddr struct {
// contains filtered or unexported fields
}
EmailAddr provides utility functions on a wrapped email address.
func NewEmailAddr ¶
NewEmailAddr returns a EmailAddr wrapper around an email address string. The incoming email address does not need to be canonicalized.
type Link ¶
type Link struct { Rel string `json:"rel"` Type string `json:"type,omitempty"` Href string `json:"href"` Titles []string `json:"titles,omitempty"` Properties map[string]string `json:"properties,omitempty"` }
Defined in: http://tools.ietf.org/html/draft-ietf-appsawg-webfinger
type Lookup ¶
type Lookup interface {
WebFinger(string) (*WebFingerResponse, error)
}
Lookup performs a WebFinger query for an email address and returns all known data for that address. Implementations may do standard WebFinger lookups over the network, fallback to using the WebFist network, or use local storage to map email address to WebFinger response.
type RecentMeta ¶
RecentMeta describes an encrypted email in the storage system.
type Storage ¶
type Storage interface { PutEmail(*EmailAddr, *Email) error Emails(*EmailAddr) ([]*Email, error) // StatEncryptedBlob returns the size of the encrypted blob on // disk. addrKey (the Email's HexKey) and encSHA1 (the SHA-1 // of the encrypted email) are lowercase hex. The err will be // os.ErrNotExist if the file is doesn't exist. StatEncryptedEmail(addrKey, encSHA1 string) (size int, err error) // EncryptedEmail returns the encrypted email with for the // addrKey (the Email's HexKey) and encSHA1 (the SHA-1 of | // fi, err := os.Stat(s.hexPath(sha1)) the encrypted // email). Both are lowercase hex. The err will be // os.ErrNotExist if the file is doesn't exist. EncryptedEmail(addrKey, sha1 string) ([]byte, error) PutEncryptedEmail(addrKey, sha1 string, data []byte) error // RecentMeta returns the recently-received encrypted emails. RecentMeta() ([]*RecentMeta, error) }
Storage is the interface implemented by backends.