mapper

package
v0.0.0-...-a35f291 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DraftStateActive = 0
	DraftStateDone   = 1
)
View Source
const MAPPER_MANAGER_ID = "MapperManager"

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	Summary string /* Echo summary           */

	MessageCount int /* Echo message count     */
	// contains filtered or unexported fields
}

func NewArea

func NewArea() *Area

func (Area) GetAreaIndex

func (self Area) GetAreaIndex() string

func (Area) GetCharset

func (self Area) GetCharset() string

func (Area) GetName

func (self Area) GetName() string

func (*Area) GetNewMessageCount

func (self *Area) GetNewMessageCount() int

func (*Area) GetOrder

func (self *Area) GetOrder() int64

func (*Area) GetSummary

func (self *Area) GetSummary() string

func (*Area) SetAreaIndex

func (self *Area) SetAreaIndex(areaIndex string)

func (*Area) SetCharset

func (self *Area) SetCharset(newCharset string)

func (*Area) SetName

func (self *Area) SetName(name string)

func (*Area) SetNewMessageCount

func (self *Area) SetNewMessageCount(newMessageCount int)

func (*Area) SetOrder

func (self *Area) SetOrder(order int64)

func (*Area) SetSummary

func (self *Area) SetSummary(summary string)

type AreaList

type AreaList struct {
	Areas []*Area
}

func (*AreaList) Reset

func (self *AreaList) Reset()

func (*AreaList) SearchByName

func (self *AreaList) SearchByName(echoTag string) (*Area, error)

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (Config) Get

func (self Config) Get(section string, name string) (string, bool)

func (Config) GetParams

func (self Config) GetParams() []ConfigValue

func (*Config) Set

func (self *Config) Set(section string, name string, value string)

type ConfigMapper

type ConfigMapper struct {
	Mapper
}

func NewConfigMapper

func NewConfigMapper(r *registry.Container) *ConfigMapper

func (ConfigMapper) GetConfigFromDatabase

func (self ConfigMapper) GetConfigFromDatabase() (*Config, error)

func (*ConfigMapper) SetConfigToDatabase

func (self *ConfigMapper) SetConfigToDatabase(config *Config)

type ConfigValue

type ConfigValue struct {
	// contains filtered or unexported fields
}

func (*ConfigValue) GetValue

func (self *ConfigValue) GetValue() string

type Draft

type Draft struct {
	// contains filtered or unexported fields
}

func NewDraft

func NewDraft() *Draft

func (Draft) GetArea

func (self Draft) GetArea() string

func (Draft) GetBody

func (self Draft) GetBody() string

func (Draft) GetFrom

func (self Draft) GetFrom() string

func (Draft) GetId

func (self Draft) GetId() string

func (Draft) GetReply

func (self Draft) GetReply() string

func (Draft) GetSubject

func (self Draft) GetSubject() string

func (Draft) GetTo

func (self Draft) GetTo() string

func (Draft) GetToAddr

func (self Draft) GetToAddr() string

func (Draft) GetUUID

func (self Draft) GetUUID() string

func (Draft) IsDone

func (self Draft) IsDone() bool

func (Draft) IsEchoMail

func (self Draft) IsEchoMail() bool

func (Draft) IsReply

func (self Draft) IsReply() bool

func (*Draft) SetArea

func (self *Draft) SetArea(area string)

func (*Draft) SetBody

func (self *Draft) SetBody(body string)

func (*Draft) SetId

func (self *Draft) SetId(id string)

func (*Draft) SetReply

func (self *Draft) SetReply(reply string)

func (*Draft) SetState

func (self *Draft) SetState(state int)

func (*Draft) SetSubject

func (self *Draft) SetSubject(subj string)

func (*Draft) SetTo

func (self *Draft) SetTo(to string)

func (*Draft) SetToAddr

func (self *Draft) SetToAddr(addr string)

func (*Draft) SetUUID

func (self *Draft) SetUUID(uuid string)

type DraftMapper

type DraftMapper struct {
	Mapper
}

func NewDraftMapper

func NewDraftMapper(r *registry.Container) *DraftMapper

func (DraftMapper) GetDraftByUUID

func (self DraftMapper) GetDraftByUUID(uuid string) (*Draft, error)

func (DraftMapper) GetDraftMessages

func (self DraftMapper) GetDraftMessages(state int) ([]Draft, error)

func (DraftMapper) RegisterNewDraft

func (self DraftMapper) RegisterNewDraft(draft Draft) error

func (DraftMapper) RemoveByUUID

func (self DraftMapper) RemoveByUUID(uuid string) error

func (DraftMapper) UpdateDraft

func (self DraftMapper) UpdateDraft(newDraft Draft) error

type EchoAreaMapper

type EchoAreaMapper struct {
	Mapper
}

func NewEchoAreaMapper

func NewEchoAreaMapper(r *registry.Container) *EchoAreaMapper

func (*EchoAreaMapper) GetAreaByAreaIndex

func (self *EchoAreaMapper) GetAreaByAreaIndex(areaIndex string) (*Area, error)

func (*EchoAreaMapper) GetAreaByName

func (self *EchoAreaMapper) GetAreaByName(areaName string) (*Area, error)

func (*EchoAreaMapper) GetAreas

func (self *EchoAreaMapper) GetAreas() ([]Area, error)

func (*EchoAreaMapper) Register

func (self *EchoAreaMapper) Register(a *Area) error

func (*EchoAreaMapper) RemoveAreaByName

func (self *EchoAreaMapper) RemoveAreaByName(echoName string) error

func (*EchoAreaMapper) Update

func (self *EchoAreaMapper) Update(area *Area) error

type EchoMapper

type EchoMapper struct {
	Mapper
}

func NewEchoMapper

func NewEchoMapper(r *registry.Container) *EchoMapper

func (*EchoMapper) GetAreaList

func (self *EchoMapper) GetAreaList() ([]string, error)

func (*EchoMapper) GetMessageByHash

func (self *EchoMapper) GetMessageByHash(echoTag string, msgHash string) (*msg.Message, error)

func (*EchoMapper) GetMessageHeaders

func (self *EchoMapper) GetMessageHeaders(echoTag string) ([]msg.Message, error)

func (*EchoMapper) GetMessageNewCount

func (self *EchoMapper) GetMessageNewCount() (int, error)

func (*EchoMapper) IsMessageExistsByHash

func (self *EchoMapper) IsMessageExistsByHash(echoTag string, msgHash string) (bool, error)

func (*EchoMapper) MarkAllReadByAreaName

func (self *EchoMapper) MarkAllReadByAreaName(echoTag string) error

func (*EchoMapper) RemoveMessageByHash

func (self *EchoMapper) RemoveMessageByHash(echoTag string, msgHash string) error

func (*EchoMapper) RemoveMessagesByAreaName

func (self *EchoMapper) RemoveMessagesByAreaName(echoTag string) error

func (*EchoMapper) UpdateAreaMessageCounters

func (self *EchoMapper) UpdateAreaMessageCounters(areas []Area) ([]Area, error)

func (*EchoMapper) ViewMessageByHash

func (self *EchoMapper) ViewMessageByHash(echoTag string, msgHash string) error

func (*EchoMapper) Write

func (self *EchoMapper) Write(msg msg.Message) error

type File

type File struct {
	// contains filtered or unexported fields
}

func NewFile

func NewFile() *File

func (*File) GetAbsolutePath

func (self *File) GetAbsolutePath() string

func (File) GetArea

func (self File) GetArea() string

func (File) GetDesc

func (self File) GetDesc() string

func (File) GetFile

func (self File) GetFile() string

func (File) GetOrigName

func (self File) GetOrigName() string

func (File) GetTime

func (self File) GetTime() time.Time

func (File) GetUnixTime

func (self File) GetUnixTime() int64

func (File) GetViewCount

func (self File) GetViewCount() int

func (File) IsNew

func (self File) IsNew() bool

func (*File) SetAbsolutePath

func (self *File) SetAbsolutePath(path string)

func (*File) SetArea

func (self *File) SetArea(area string)

func (*File) SetDesc

func (self *File) SetDesc(desc string)

func (*File) SetFile

func (self *File) SetFile(file string)

func (*File) SetOrigName

func (self *File) SetOrigName(orig_name string)

func (*File) SetUnixTime

func (self *File) SetUnixTime(unixTime int64)

func (*File) SetViewCount

func (self *File) SetViewCount(viewCount int)

type FileArea

type FileArea struct {
	Path string
	// contains filtered or unexported fields
}

func NewFileArea

func NewFileArea() *FileArea

func (FileArea) GetCharset

func (self FileArea) GetCharset() string

func (*FileArea) GetCount

func (self *FileArea) GetCount() int

func (FileArea) GetMode

func (self FileArea) GetMode() string

func (FileArea) GetName

func (self FileArea) GetName() string

func (*FileArea) GetNewCount

func (self *FileArea) GetNewCount() int

func (*FileArea) GetOrder

func (self *FileArea) GetOrder() int

func (FileArea) GetSummary

func (self FileArea) GetSummary() string

func (*FileArea) SetCharset

func (self *FileArea) SetCharset(charset string)

func (*FileArea) SetCount

func (self *FileArea) SetCount(count int)

func (*FileArea) SetMode

func (self *FileArea) SetMode(mode string)

func (*FileArea) SetName

func (self *FileArea) SetName(name string)

func (*FileArea) SetNewCount

func (self *FileArea) SetNewCount(count int)

func (*FileArea) SetSummary

func (self *FileArea) SetSummary(summary string)

type FileAreaMapper

type FileAreaMapper struct {
	Mapper
}

func NewFileAreaMapper

func NewFileAreaMapper(r *registry.Container) *FileAreaMapper

func (*FileAreaMapper) CreateFileArea

func (self *FileAreaMapper) CreateFileArea(a *FileArea) error

func (*FileAreaMapper) GetAreaByName

func (self *FileAreaMapper) GetAreaByName(areaName string) (*FileArea, error)

func (*FileAreaMapper) GetAreas

func (self *FileAreaMapper) GetAreas() ([]FileArea, error)

func (FileAreaMapper) GetMessageNewCount

func (self FileAreaMapper) GetMessageNewCount() (int, error)

func (*FileAreaMapper) UpdateFileAreasWithFileCount

func (self *FileAreaMapper) UpdateFileAreasWithFileCount(fileAreas []FileArea) ([]FileArea, error)

func (*FileAreaMapper) UpdateNewFileAreasWithFileCount

func (self *FileAreaMapper) UpdateNewFileAreasWithFileCount(fileAreas []FileArea) ([]FileArea, error)

type FileMapper

type FileMapper struct {
	Mapper
}

func NewFileMapper

func NewFileMapper(r *registry.Container) *FileMapper

func (*FileMapper) CheckFileExists

func (self *FileMapper) CheckFileExists(tic File) (bool, error)

func (FileMapper) GetFileAbsolutePath

func (self FileMapper) GetFileAbsolutePath(areaName string, name string) string

func (*FileMapper) GetFileBoxAbsolutePath

func (self *FileMapper) GetFileBoxAbsolutePath(areaName string) string

func (*FileMapper) GetFileByIndexName

func (self *FileMapper) GetFileByIndexName(echoTag string, indexName string) (*File, error)

func (*FileMapper) GetFileHeaders

func (self *FileMapper) GetFileHeaders(echoTag string) ([]File, error)

func (*FileMapper) GetFileNewCount

func (self *FileMapper) GetFileNewCount() (int, error)

func (*FileMapper) RegisterFile

func (self *FileMapper) RegisterFile(tic File) error

func (*FileMapper) RemoveAreaByName

func (self *FileMapper) RemoveAreaByName(areaName string) error

func (*FileMapper) RemoveFileByName

func (self *FileMapper) RemoveFileByName(indexName string) error

func (*FileMapper) RemoveFilesByAreaName

func (self *FileMapper) RemoveFilesByAreaName(areaName string) error

func (*FileMapper) ViewFileByIndexName

func (self *FileMapper) ViewFileByIndexName(fileArea string, indexName string) error

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

func (*Mapper) SetRegistry

func (self *Mapper) SetRegistry(r *registry.Container)

type MapperManager

type MapperManager struct {
	// contains filtered or unexported fields
}

func NewMapperManager

func NewMapperManager(r *registry.Container) *MapperManager

func RestoreMapperManager

func RestoreMapperManager(r *registry.Container) *MapperManager

func (MapperManager) GetConfigMapper

func (self MapperManager) GetConfigMapper() *ConfigMapper

func (MapperManager) GetDraftMapper

func (self MapperManager) GetDraftMapper() *DraftMapper

func (MapperManager) GetEchoAreaMapper

func (self MapperManager) GetEchoAreaMapper() *EchoAreaMapper

func (MapperManager) GetEchoMapper

func (self MapperManager) GetEchoMapper() *EchoMapper

/ GetEchoMapper provide echo mapper

func (MapperManager) GetFileAreaMapper

func (self MapperManager) GetFileAreaMapper() *FileAreaMapper

func (MapperManager) GetFileMapper

func (self MapperManager) GetFileMapper() *FileMapper

func (MapperManager) GetNetmailMapper

func (self MapperManager) GetNetmailMapper() *NetmailMapper

func (MapperManager) GetStatMailerMapper

func (self MapperManager) GetStatMailerMapper() *StatMailerMapper

func (MapperManager) GetTwitMapper

func (self MapperManager) GetTwitMapper() *TwitMapper

type NetmailMapper

type NetmailMapper struct {
	Mapper
}

func NewNetmailMapper

func NewNetmailMapper(r *registry.Container) *NetmailMapper

func (*NetmailMapper) GetMessageByHash

func (self *NetmailMapper) GetMessageByHash(msgHash string) (*NetmailMsg, error)

func (*NetmailMapper) GetMessageHeaders

func (self *NetmailMapper) GetMessageHeaders() ([]*NetmailMsg, error)

func (*NetmailMapper) GetMessageNewCount

func (self *NetmailMapper) GetMessageNewCount() (int, error)

func (*NetmailMapper) RemoveMessageByHash

func (self *NetmailMapper) RemoveMessageByHash(msgHash string) error

func (*NetmailMapper) ViewMessageByHash

func (self *NetmailMapper) ViewMessageByHash(msgHash string) error

func (*NetmailMapper) Write

func (self *NetmailMapper) Write(msg *NetmailMsg) error

type NetmailMsg

type NetmailMsg struct {
	ID          string
	MsgID       string
	Hash        string
	From        string
	To          string
	OrigAddr    string
	DestAddr    string
	Subject     string
	Content     string
	UnixTime    int64
	ViewCount   int
	DateWritten time.Time
	// contains filtered or unexported fields
}

func NewNetmailMsg

func NewNetmailMsg() *NetmailMsg

func (*NetmailMsg) GetContent

func (self *NetmailMsg) GetContent() string

func (*NetmailMsg) GetFrom

func (self *NetmailMsg) GetFrom() string

func (*NetmailMsg) GetPacket

func (self *NetmailMsg) GetPacket() []byte

func (*NetmailMsg) SetContent

func (self *NetmailMsg) SetContent(body string) *NetmailMsg

func (*NetmailMsg) SetDestAddr

func (self *NetmailMsg) SetDestAddr(addr string)

func (*NetmailMsg) SetFrom

func (self *NetmailMsg) SetFrom(from string)

func (*NetmailMsg) SetHash

func (self *NetmailMsg) SetHash(hash string) *NetmailMsg

func (*NetmailMsg) SetID

func (self *NetmailMsg) SetID(id string)

func (*NetmailMsg) SetMsgID

func (self *NetmailMsg) SetMsgID(msgID string)

func (*NetmailMsg) SetOrigAddr

func (self *NetmailMsg) SetOrigAddr(addr string)

func (*NetmailMsg) SetPacket

func (self *NetmailMsg) SetPacket(packet []byte)

func (*NetmailMsg) SetSubject

func (self *NetmailMsg) SetSubject(subject string)

func (*NetmailMsg) SetTime

func (self *NetmailMsg) SetTime(ptm time.Time)

func (*NetmailMsg) SetTo

func (self *NetmailMsg) SetTo(to string)

func (*NetmailMsg) SetUnixTime

func (self *NetmailMsg) SetUnixTime(unixTime int64)

func (*NetmailMsg) SetViewCount

func (self *NetmailMsg) SetViewCount(count int) *NetmailMsg

type StatMailer

type StatMailer struct {
	SessionID    int64  /* Timestamp in nanoseconds      */
	SessionStart int64  /* Session start in milliseconds */
	SessionStop  int64  /* Session stop in milliseconds  */
	Status       string /* Summary report                */
}

func (StatMailer) GetDuration

func (self StatMailer) GetDuration() uint64

type StatMailerMapper

type StatMailerMapper struct {
	Mapper
}

func NewStatMailerMapper

func NewStatMailerMapper(r *registry.Container) *StatMailerMapper

func (*StatMailerMapper) GetMailerSummary

func (self *StatMailerMapper) GetMailerSummary() ([]StatMailer, error)

func (*StatMailerMapper) UpdateSession

func (self *StatMailerMapper) UpdateSession(mailerReport *StatMailer) error

type Twit

type Twit struct {
	// contains filtered or unexported fields
}

func NewTwit

func NewTwit() *Twit

func (Twit) GetId

func (self Twit) GetId() string

func (Twit) GetName

func (self Twit) GetName() string

func (*Twit) SetId

func (self *Twit) SetId(id string)

func (*Twit) SetName

func (self *Twit) SetName(name string)

type TwitMapper

type TwitMapper struct {
	Mapper
}

func NewTwitMapper

func NewTwitMapper(r *registry.Container) *TwitMapper

func (TwitMapper) GetTwitNames

func (self TwitMapper) GetTwitNames() ([]Twit, error)

func (TwitMapper) RegisterTwitByName

func (self TwitMapper) RegisterTwitByName(twitName string) error

func (TwitMapper) RemoveById

func (self TwitMapper) RemoveById(twitId string) error

Jump to

Keyboard shortcuts

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