sql

package
v0.0.0-...-e6c6cbb Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ID             int
	MessageID      int    `db:"message_id"`
	OriginalName   string `db:"original_name"`
	Filename       string
	AttachmentPass string `db:"attachment_pass"`
	IsForwarded    bool   `db:"is_forwarded"`
	URLToForward   string `db:"url_to_forward"`
}

func NewAttachment

func NewAttachment(ID int, MessageID int, OriginalName string, Filename string, Pass string, IsForwarded bool, URLToForward string) Attachment

type Message

type Message struct {
	ID         int
	OriginalID int    `db:"original_id"`
	ServerID   int    `db:"server_id"`
	ReplyPass  string `db:"reply_pass"`
	ReplyID    string `db:"reply_id"`
	Type       string
	IsDraft    bool `db:"is_draft"`
}

func NewDraftMessage

func NewDraftMessage(id int, originalID int, replypass string, replyid string) Message

func NewMessage

func NewMessage(ID int, OriginalID int, ServerID int, ReplyPass string, ReplyID string, Type string, IsDraft bool) Message

type ReceivedMessage

type ReceivedMessage struct {
	ID         int
	Title      string
	URI        string
	ToEmail    string `db:"to_email"`
	FromEmail  string `db:"from_email"`
	ServerID   int    `db:"server_id"`   // This is used to get specific message from server
	ServerPass string `db:"server_pass"` // This is password used to access this email from server
	Warning    string
	MVPPass    string `db:"mvp_pass"`
	IsRead     bool   `db:"is_read"`
}

func NewReceivedMessage

func NewReceivedMessage(
	id int, title string, URI string, to string, from string, sid int, pass string, warning string, mvppass string) ReceivedMessage

type ReceivedMessageJSON

type ReceivedMessageJSON struct {
	ID        int    `json:"ID"`
	Title     string `json:"Title"`
	URI       string `json:"URI"`
	ToEmail   string `json:"To"`
	FromEmail string `json:"From"`
	Type      string `json:"Type"`
}

type SQL

type SQL interface {
	Init()
	GetReceivedMessage(int) (*ReceivedMessage, error)
	GetDB() *sqlx.DB
	CommitReceivedMessages(ReceivedMessage) error
	GetInbox(string) ([]ReceivedMessage, error)
	GetAllSentMessages(string) ([]SentMessage, error)
	GenerateNewTransaction()
	NewUser(string, string) error
	GetUserByEmail(string) (User, error)
	Commit() error
	CommitSentMessage(SentMessage) error
	GetSentMessage(int) (*SentMessage, error)
	GetLastMessageID() int
	CommitMessage(message Message) error
	GetOriginalMessageFromOriginalID(int) (*Message, error)
	GetOriginalMessageFromReplyTo(int) (*Message, error)
	GetMessageFromReplyTo(int) (*Message, error)
	GetOriginalFromReplyHeaders(string, string) (Message, error)
	DeleteMessage(int) error
	DeleteSentMessage(int) error
	UpdateDraftSentMessage(SentMessage) error
	UpdateDraftMessage(Message) error
	CommitAttachment(Attachment) error
	GetLastAttachmentID() int
	GetAttachment(int, int) (*Attachment, error)
	DeleteAttachment(int, int) error
	GetAllAttachments(int) ([]Attachment, error)
	UpdateReceivedMessage(ReceivedMessage) error
	GetReplies(Message, string) ([]interface{}, error)
	UpdateUserData(User) error
	DeleteReceivedMessage(int) error
}

func NewSQL

func NewSQL(driver string, drivername string, logger *zap.SugaredLogger) (SQL, error)

type SentMessage

type SentMessage struct {
	ID        int
	Title     string
	Body      string
	ToEmail   string `db:"to_email"`
	FromEmail string `db:"from_email"`
	Pass      string
	MVPPass   string `db:"mvp_pass"`
}

func NewDraftSentMessage

func NewDraftSentMessage(id int, title string, to string, from string, body string) SentMessage

func NewSentMessage

func NewSentMessage(id int, title string, to string, from string, body string, pass string, mvppass string) SentMessage

type SentMessageJSON

type SentMessageJSON struct {
	ID        int    `json:"ID"`
	Title     string `json:"Title"`
	Body      string `json:"Body"`
	ToEmail   string `json:"To"`
	FromEmail string `json:"From"`
	Type      string `json:"Type"`
}

type User

type User struct {
	ID        int
	Email     string
	Password  string `db:"pass"`
	Signature string
}

func NewUser

func NewUser(email string, password string) User

Jump to

Keyboard shortcuts

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