Documentation
¶
Index ¶
- func Request(data map[string]any, opts ...Option) (map[string]any, error)
- type Callback
- type Command
- type CopyData
- type CreateData
- type Criteria
- type Data
- type DeleteData
- type FetchData
- type ListData
- type MailboxInfo
- type Message
- type NoopData
- type Option
- type RenameData
- type Req
- func (r *Req) Copy(sequence, mailbox string) (*CopyData, error)
- func (r *Req) Create(mailbox string) (*CreateData, error)
- func (r *Req) Delete(mailbox string) (*DeleteData, error)
- func (r *Req) Do() (*Result, error)
- func (r *Req) Examine(mb string) (*SelectData, error)
- func (r *Req) ExecCommands() (*Data, error)
- func (r *Req) Fetch(sequence, dataitem string) (*FetchData, error)
- func (r *Req) List(ref, pattern string) (*ListData, error)
- func (r *Req) Noop() (*NoopData, error)
- func (r *Req) Rename(oldMailbox, newMailbox string) (*RenameData, error)
- func (r *Req) Search(cr *Criteria) (*SearchData, error)
- func (r *Req) Select(mb string) (*SelectData, error)
- func (r *Req) Store(sequence, dataitem, value string) (*StoreData, error)
- func (r *Req) Subscribe(mailbox string) (*StatusData, error)
- func (r *Req) UIDFetch(sequence, dataitem string) (*FetchData, error)
- func (r *Req) UIDSearch(cr *Criteria) (*SearchData, error)
- func (r *Req) Unsubscribe(mailbox string) (*StatusData, error)
- type Res
- type Result
- type SearchData
- type SelectData
- type StatusData
- type StoreData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
Name string `map:"name" validate:"required"`
Mailbox string `map:"mailbox"`
OldMailbox string `map:"oldmailbox"`
NewMailbox string `map:"newmailbox"`
Reference string `map:"reference"`
Pattern string `map:"pattern"`
Criteria Criteria `map:"criteria"`
Sequence string `map:"sequence"`
Dataitem string `map:"dataitem"`
Value string `map:"value"`
}
Without login, logout and Expunge
type CreateData ¶
type Criteria ¶
type Criteria struct {
SeqNums []string `map:"seq_nums"`
UIDs []string `map:"uids"`
Since string `map:"since"`
Before string `map:"before"`
SentSince string `map:"sent_since"`
SentBefore string `map:"sent_before"`
Headers map[string]string `map:"headers"`
Bodies []string `map:"bodies"`
Texts []string `map:"texts"`
Flags []string `map:"flags"`
NotFlags []string `map:"not_flags"`
}
type Data ¶
type Data struct {
Select SelectData `map:"select"`
Examine SelectData `map:"examine"`
Search SearchData `map:"search"`
List ListData `map:"list"`
Fetch FetchData `map:"fetch"`
Store StoreData `map:"store"`
Copy CopyData `map:"copy"`
Create CreateData `map:"create"`
Delete DeleteData `map:"delete"`
Rename RenameData `map:"rename"`
Subscribe StatusData `map:"subscribe"`
Unsubscribe StatusData `map:"unsubscribe"`
Noop NoopData `map:"noop"`
}
type DeleteData ¶
type ListData ¶
type ListData struct {
Mailboxes []MailboxInfo `map:"mailboxes"`
Count int `map:"count"`
}
type MailboxInfo ¶
type Message ¶
type Message struct {
UID int `map:"uid"`
Flags []string `map:"flags"`
Date time.Time `map:"date"`
From string `map:"from"`
To string `map:"to"`
Subject string `map:"subject"`
Body string `map:"body"`
HTMLBody string `map:"html_body"`
Size int `map:"size"`
Headers map[string]string `map:"headers"`
}
Message represents an email message
type RenameData ¶
type Req ¶
type Req struct {
Host string `map:"host" validate:"required"`
Port int `map:"port" validate:"required"`
Username string `map:"username" validate:"required"`
Password string `map:"password" validate:"required"`
TLS bool `map:"tls"`
Timeout time.Duration `map:"timeout"`
StrictHostCheck bool `map:"strict_host_check"`
InsecureSkipTLS bool `map:"insecure_skip_tls"`
Commands []Command `map:"commands"`
// contains filtered or unexported fields
}
func (*Req) Create ¶
func (r *Req) Create(mailbox string) (*CreateData, error)
Create implements CREATE command
func (*Req) Delete ¶
func (r *Req) Delete(mailbox string) (*DeleteData, error)
Delete implements DELETE command
func (*Req) Examine ¶
func (r *Req) Examine(mb string) (*SelectData, error)
Examine implements EXAMINE command (read-only SELECT)
func (*Req) ExecCommands ¶
DEBUG: hclog.Default().Info(fmt.Sprintf("%#v\n", data))
func (*Req) Rename ¶
func (r *Req) Rename(oldMailbox, newMailbox string) (*RenameData, error)
Rename implements RENAME command
func (*Req) Subscribe ¶
func (r *Req) Subscribe(mailbox string) (*StatusData, error)
Subscribe implements SUBSCRIBE command
func (*Req) Unsubscribe ¶
func (r *Req) Unsubscribe(mailbox string) (*StatusData, error)
Unsubscribe implements UNSUBSCRIBE command
type SearchData ¶
type SelectData ¶
type StatusData ¶
Click to show internal directories.
Click to hide internal directories.