tegutypes

package
v1.1.50 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxValuesStruct

type CtxValuesStruct struct {
	Debug     bool
	NodeID    string
	DataDir   string
	PluginDir string
	Settings  SettingsDbPlugin
	Plugins   PluginEngine
	Queue     SmtpQueuePlugin
}

type DeliveryItem

type DeliveryItem struct {
	MID    string
	Helo   string
	IP     string
	TLS    bool
	Sender string
	Rcpt   string
	MsgRW  MessageReaderWriter
	Body   []byte
}

-----------------------------------------------------------------------------

type DeliveryState

type DeliveryState struct {
	DestDir     string
	CopyToDir   []string
	AddFlags    []string
	Store       bool
	Redirected  bool
	StopProcess bool
}

type ImapFetchIter

type ImapFetchIter interface {
	ImapIterator
	Val(context.Context) (uint64, string, error)
}

type ImapFolder

type ImapFolder interface {
	Close(context.Context) error
	GetSubscription(context.Context) (ImapSubscription, error)
	GetParsedRules(context.Context) ([]*RuleStruct, error)
	SaveRules(context.Context, []*RuleStruct) error
	GetMsgTime(context.Context, *ImapMsgInfo) (time.Time, error)
	GetMsgBodystructure(context.Context, *ImapMsgInfo) (string, string, error)
	GetMsgEnvelopeFields(context.Context, *ImapMsgInfo) (string, error)
	GetMsgFlagNames(context.Context, *ImapMsgInfo) ([]string, error)
	AddFlagNamesToMsg(context.Context, *ImapMsgInfo, []string) (int, []string, error)
	SetMsgFlagNames(context.Context, *ImapMsgInfo, []string) (int, []string, error)
	DelFlagNamesFromMsg(context.Context, *ImapMsgInfo, []string) (int, []string, error)
	GetName(context.Context) string
	GetUsage(context.Context) (int, error)
	GetUidValidity(context.Context) (uint64, error)
	GetCurrentMsgCount(context.Context) (uint64, error)
	GetUidNext(context.Context) (uint64, error)
	GetFirstUnseenNum(context.Context) (uint64, error)
	CheckRecent(context.Context, bool) (uint64, error)
	GetReaderWriterForNewMessage(context.Context) (MessageReaderWriter, error)
	AddMsg(context.Context, MessageReaderWriter, time.Time) (string, error)
	AddFolder(context.Context, string) error
	GetFolder(context.Context, string) (ImapFolder, error)
	RemoveFolder(context.Context, string) error
	RenameFolder(context.Context, string, string) error
	ExpungeReturnNums(context.Context) ([]uint64, error)
	GetSystemFolders(context.Context) ([]string, error)
	GetIMAPDefaultFolders(context.Context) (map[string]string, error)
	GetSearchIter(context.Context, string, bool) (ImapSearchIter, error)
	GetFetchIter(context.Context, string, string, bool) (ImapFetchIter, error)
	GetStoreIter(context.Context, string, string, string, bool, bool) (ImapStoreFlagsIter, error)
	CopyTo(context.Context, string, int, int, int, ImapFolder, bool) error
	ListFolders(context.Context) ([]string, error)
	ExistingFlags(context.Context) ([]string, error)
	SetReadOnly(context.Context, bool) error
	IsReadOnly(context.Context) bool
}

type ImapIterator

type ImapIterator interface {
	Next(context.Context) bool
	Close(context.Context) error
}

type ImapMboxInfo

type ImapMboxInfo struct {
	Recent, Unseen, Exists, Uidnext, Uidvalidity uint64
}

type ImapMessage

type ImapMessage interface {
	SetInfo(*ImapMsgInfo)
	GetInfo() *ImapMsgInfo
	GetPartBySectionNum(partN []int) ImapMessage
	GetAsBytes() []byte
	GetBody() ([]byte, error)
	GetDecodedText() ([]byte, error)
	GetHeader() ImapMessageHeader
	IsMultipart() bool
	MultipartReader() ImapMessageMultipartReader
	Close() error
}

type ImapMessageHeader

type ImapMessageHeader interface {
	ContentType() (string, map[string]string, error)
	Text(string) (string, error)
	GetFields() ImapMessageHeaderFields
	FieldsByKey(k string) ImapMessageHeaderFields
	Get(string) string
}

type ImapMessageHeaderFields

type ImapMessageHeaderFields interface {
	Next() bool
	Raw() ([]byte, error)
	Key() string
	Value() string
	Text() (string, error)
}

-----------------------------------------------------------------------------

type ImapMessageMultipartReader

type ImapMessageMultipartReader interface {
	NextPart() (ImapMessage, error)
}

type ImapMsgInfo

type ImapMsgInfo struct {
	Uid    uint64
	Num    uint64
	Mid    string
	Date   int64
	Size   int64
	Params map[string]string
}

-----------------------------------------------------------------------------

type ImapMsgInfoIter

type ImapMsgInfoIter interface {
	ImapIterator
	Val(context.Context) (*ImapMsgInfo, error)
}

type ImapNumSetIter

type ImapNumSetIter interface {
	Next(context.Context) bool
	Val(context.Context) (*ImapMsgInfo, error)
	Valid(context.Context) bool
	Close(context.Context) error
}

type ImapSearchIter

type ImapSearchIter interface {
	ImapIterator
	Val(context.Context) (uint64, error)
}

type ImapSetRange

type ImapSetRange struct {
	Start uint64
	End   uint64
}

type ImapStoreFlagsIter

type ImapStoreFlagsIter interface {
	ImapIterator
	Val(context.Context) (uint64, string, error)
}

type ImapSubscription

type ImapSubscription interface {
	Subscribe(context.Context, string) error
	Unsubscribe(context.Context, string) error
	Subscribed(context.Context) ([]string, error)
	Close(context.Context) error
}

type MailStorage added in v1.1.2

type MailStorage struct {
	MailDomain string
	PluginName string
	PluginDesc string
}

type MailstoragePlugin

type MailstoragePlugin interface {
	Plugin
	GetInbox(context.Context, string, string) (ImapFolder, error)
	GetDefaultQuota(context.Context, string) (int, error)
	GetTrashAdditionalQuota(context.Context, string) (int, error)
	GetSmartHost(context.Context, string) (*SmartHost, error)
	GetMboxCount(context.Context, string) (uint64, error)
}

type MessageReaderWriter

type MessageReaderWriter interface {
	FileName() string
	Name() string // путь до файла, как был передан при открытии
	Read(p []byte) (n int, err error)
	ReadAll() ([]byte, error)
	Seek(offset int64, whence int) (int64, error)
	Write([]byte) (int, error)
	Sync() error
	Close() error
	ReOpen() error
	Destroy() error
	GetFlags() []string
	SetFlags([]string)
	Params() map[string]interface{}
}

----------------------------------------------------------------------------- -----------------------------------------------------------------------------

type MiscPlugin added in v1.1.20

type MiscPlugin interface {
	Plugin
}

type Plugin

type Plugin interface {
	IsShared(context.Context) bool
	Init(context.Context) bool
	GetName(context.Context) (string, error)
	GetPType(context.Context) (int, error)
	GetDesc(context.Context) (string, error)
	GetVersion(context.Context) (string, error)
	GetEmptySettings(context.Context) ([]interface{}, error)
	GetSettings(context.Context, string) ([]interface{}, error)
	SetSettings(context.Context, string, map[string]string) error
	DelSettings(context.Context, string) error
	WebExists(context.Context) bool
	Web(context.Context, string, string, map[string]string) (interface{}, error)
	Do(context.Context, string, map[string]interface{}) (interface{}, error)
}

type PluginEngine added in v1.1.2

type PluginEngine interface {
	Get(context.Context, string, int) (interface{}, error)
	GetAll(context.Context, int) ([]interface{}, error)
	Set(context.Context, string, int, *plugin.Plugin) error
	Init(context.Context)
	UserDBPluginCount(context.Context) int
	MailstoragePluginCount(context.Context) int
	SmtpQueuePluginCount(context.Context) int
	SettingsDbPluginCount(context.Context) int
	MiscPluginCount(context.Context) int
	GetPluginNamesDesc(context.Context, int) ([][]string, error)
}

type QueueItem

type QueueItem struct {
	QId              string
	RetryCount       int
	LastTryTimestamp int64
	MessageId        string
	Helo             string
	Ip               string
	Tls              bool
	RecvTimestamp    int64
	SenderEmail      string
	RcptEmail        string
}

-----------------------------------------------------------------------------

type QueueMessage

type QueueMessage struct {
	ReaderWriter MessageReaderWriter
	IP           string
	Helo         string
	SenderEmail  string
	Recipients   []string
	TLS          bool
	ID           string
	ListedAt     []string
}

type RuleActionStruct

type RuleActionStruct struct {
	Actions [][]string
}

type RuleConditionStruct

type RuleConditionStruct struct {
	Op         string
	Conditions [][]string
}

type RuleStruct

type RuleStruct struct {
	Name      string
	Condition *RuleConditionStruct
	Action    *RuleActionStruct
}

type SettingsDbPlugin

type SettingsDbPlugin interface {
	Plugin
	Open(context.Context, map[string]string) error
	SetString(context.Context, string, string) error
	SetStringList(context.Context, string, []string) error
	SetInt(context.Context, string, int64) error
	SetIntList(context.Context, string, []int64) error
	SetFloat(context.Context, string, float64) error
	SetFloatList(context.Context, string, []float64) error
	SetBool(context.Context, string, bool) error
	GetString(context.Context, string) (string, error)
	GetStringList(context.Context, string) ([]string, error)
	GetInt(context.Context, string) (int64, error)
	GetIntList(context.Context, string) ([]int64, error)
	GetFloat(context.Context, string) (float64, error)
	GetFloatList(context.Context, string) ([]float64, error)
	GetBool(context.Context, string) (bool, error)
	Del(context.Context, string) error
	StrListAppend(context.Context, string, string) error
	StrListExclude(context.Context, string, string) error
	StrListContains(context.Context, string, string) bool
	IntListAppend(context.Context, string, int64) error
	IntListExclude(context.Context, string, int64) error
	IntListContains(context.Context, string, int64) bool
	FloatListAppend(context.Context, string, float64) error
	FloatListExclude(context.Context, string, float64) error
	FloatListContains(context.Context, string, float64) bool
	Close(context.Context) error
}

type SmartHost

type SmartHost struct {
	Host string
	Port int
	User string
	Pass string
}

-----------------------------------------------------------------------------

type SmtpQueue added in v1.1.2

type SmtpQueue struct {
	PluginName string
}

type SmtpQueuePlugin

type SmtpQueuePlugin interface {
	Plugin
	Open(context.Context) error
	GetTempReaderWriter(context.Context) (MessageReaderWriter, error)
	GetNewMsgReaderWriter(context.Context) (MessageReaderWriter, error)
	GetQueueItems(context.Context) ([]*QueueItem, error)
	GetQueueItemReaderWriter(context.Context, string) (MessageReaderWriter, error)
	DeleteQueueItem(context.Context, string) error
	UpdateQueueRetry(context.Context, string, int, int64) error
	GetAsImapMessage(context.Context, io.Reader) (ImapMessage, error)
	IsSeen(context.Context, string, string) (bool, error)
	MarkAsSeen(context.Context, string, string) error
	Close(context.Context) error
}

type UserDBPlugin

type UserDBPlugin interface {
	Plugin
	Auth(context.Context, string, string, string, bool) (bool, error)
	UserByEmail(context.Context, string, string) (string, error)
	ExpandAlias(context.Context, string, string) ([]string, error)
	NormalEmail(context.Context, string, string) (string, error)
	UserQuotaMB(context.Context, string, string) (int, error)
}

type UserDBProvider added in v1.1.2

type UserDBProvider struct {
	Name       string
	MailDomain string
	PluginName string
	PluginDesc string
	SourceID   string
}

++++++++++++++++++++++++++++++++++++

Jump to

Keyboard shortcuts

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