mail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

Mail

Implements parsing of mail messages for Mailchain

Documentation

Overview

Package mail implements parsing of mail messages for mailchain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	DisplayName  string // Proper name; may be empty.
	FullAddress  string // 0x92d8f10248c6a3953cc3692a894655ad05d61efb@chain.network.mailchain
	ChainAddress string // 0x92d8f10248c6a3953cc3692a894655ad05d61efb
}

Address represents a single mail address. An address such as "Charlotte <0x92d8f10248c6a3953cc3692a894655ad05d61efb@ropsten.ethereum.mailchain>" is represented as Address{Name: "Charlotte", Address: "0x92d8f10248c6a3953cc3692a894655ad05d61efb@ropsten.ethereum.mailchain"}.

func ParseAddress

func ParseAddress(input, chain, network string) (*Address, error)

ParseAddress parses a single RFC 5322 address, e.g. "Charlotte <0x92d8f10248c6a3953cc3692a894655ad05d61efb@ropsten.ethereum.mailchain>" then apply it to the chain address.

func (*Address) String

func (a *Address) String() string

type Data

type Data struct {
	Version              int32    `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
	EncryptedLocation    []byte   `protobuf:"bytes,2,opt,name=encryptedLocation,proto3" json:"encryptedLocation,omitempty"`
	Hash                 []byte   `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Data) Descriptor

func (*Data) Descriptor() ([]byte, []int)

func (*Data) GetEncryptedLocation

func (m *Data) GetEncryptedLocation() []byte

func (*Data) GetHash

func (m *Data) GetHash() []byte

func (*Data) GetVersion

func (m *Data) GetVersion() int32

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) Reset

func (m *Data) Reset()

func (*Data) String

func (m *Data) String() string

func (*Data) XXX_DiscardUnknown

func (m *Data) XXX_DiscardUnknown()

func (*Data) XXX_Marshal

func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Data) XXX_Merge

func (dst *Data) XXX_Merge(src proto.Message)

func (*Data) XXX_Size

func (m *Data) XXX_Size() int

func (*Data) XXX_Unmarshal

func (m *Data) XXX_Unmarshal(b []byte) error

type Headers

type Headers struct {
	From    Address
	To      Address
	Date    time.Time
	Subject string
	ReplyTo *Address
}

Headers for the message

func NewHeaders

func NewHeaders(date time.Time, from, to Address, replyTo *Address, subject string) (*Headers, error)

NewHeaders create the headers for sending a new message

type ID

type ID multihash.Multihash

ID create the mail message ID header

func FromHexString

func FromHexString(hex string) (ID, error)

FromHexString create ID from multihash hex string

func NewID

func NewID() (ID, error)

NewID create a new secure random ID

func (ID) HexString

func (id ID) HexString() string

HexString create a multihash representation of ID as hex string

type Message

type Message struct {
	Headers *Headers
	ID      ID
	Body    []byte
}

Message Mailchain message.

func NewMessage

func NewMessage(date time.Time, from, to Address, replyTo *Address, subject string, body []byte) (*Message, error)

NewMessage create a new message used when sending a new message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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