Documentation
¶
Index ¶
- Constants
- Variables
- type Email
- func (e *Email) Delete(opts ...QueryOption) string
- func (e *Email) GetBody() string
- func (e *Email) GetCreatedAt() *time.Time
- func (e *Email) GetError() string
- func (e *Email) GetID() string
- func (e *Email) GetRecipient() string
- func (e *Email) GetRetryAt() *time.Time
- func (e *Email) GetRetryCount() int64
- func (e *Email) GetRetryError() string
- func (e *Email) GetSentAt() *time.Time
- func (e *Email) GetStatus() string
- func (e *Email) GetSubject() string
- func (e *Email) Insert(opts ...QueryOption) string
- func (e *Email) Select(opts ...QueryOption) string
- func (e *Email) SetCreatedAt(stamp time.Time)
- func (e *Email) SetRetryAt(stamp time.Time)
- func (e *Email) SetSentAt(stamp time.Time)
- func (e *Email) Update(opts ...QueryOption) string
- type EmailFailed
- func (e *EmailFailed) Delete(opts ...QueryOption) string
- func (e *EmailFailed) GetBody() string
- func (e *EmailFailed) GetCreatedAt() *time.Time
- func (e *EmailFailed) GetError() string
- func (e *EmailFailed) GetID() string
- func (e *EmailFailed) GetRecipient() string
- func (e *EmailFailed) GetRetryAt() *time.Time
- func (e *EmailFailed) GetRetryCount() int64
- func (e *EmailFailed) GetRetryError() string
- func (e *EmailFailed) GetSentAt() *time.Time
- func (e *EmailFailed) GetStatus() string
- func (e *EmailFailed) GetSubject() string
- func (e *EmailFailed) Insert(opts ...QueryOption) string
- func (e *EmailFailed) Select(opts ...QueryOption) string
- func (e *EmailFailed) SetCreatedAt(stamp time.Time)
- func (e *EmailFailed) SetRetryAt(stamp time.Time)
- func (e *EmailFailed) SetSentAt(stamp time.Time)
- func (e *EmailFailed) Update(opts ...QueryOption) string
- type EmailSent
- func (e *EmailSent) Delete(opts ...QueryOption) string
- func (e *EmailSent) GetBody() string
- func (e *EmailSent) GetCreatedAt() *time.Time
- func (e *EmailSent) GetError() string
- func (e *EmailSent) GetID() string
- func (e *EmailSent) GetRecipient() string
- func (e *EmailSent) GetRetryAt() *time.Time
- func (e *EmailSent) GetRetryCount() int64
- func (e *EmailSent) GetRetryError() string
- func (e *EmailSent) GetSentAt() *time.Time
- func (e *EmailSent) GetStatus() string
- func (e *EmailSent) GetSubject() string
- func (e *EmailSent) Insert(opts ...QueryOption) string
- func (e *EmailSent) Select(opts ...QueryOption) string
- func (e *EmailSent) SetCreatedAt(stamp time.Time)
- func (e *EmailSent) SetRetryAt(stamp time.Time)
- func (e *EmailSent) SetSentAt(stamp time.Time)
- func (e *EmailSent) Update(opts ...QueryOption) string
- type Migrations
- func (m *Migrations) Delete(opts ...QueryOption) string
- func (m *Migrations) GetFilename() string
- func (m *Migrations) GetProject() string
- func (m *Migrations) GetStatementIndex() int64
- func (m *Migrations) GetStatus() string
- func (m *Migrations) Insert(opts ...QueryOption) string
- func (m *Migrations) Select(opts ...QueryOption) string
- func (m *Migrations) Update(opts ...QueryOption) string
- type QueryConfig
- func (q *QueryConfig) Apply(opts ...QueryOption) *QueryConfig
- func (q *QueryConfig) WithColumns(cols []string) QueryOption
- func (q *QueryConfig) WithLimit(start, offset int) QueryOption
- func (q *QueryConfig) WithOrderBy(clause string) QueryOption
- func (q *QueryConfig) WithStatement(stmt string) QueryOption
- func (q *QueryConfig) WithTable(name string) QueryOption
- func (q *QueryConfig) WithWhere(clause string) QueryOption
- type QueryOption
Constants ¶
const ( StatusPending = "pending" StatusSent = "sent" StatusFailed = "failed" )
Status constants
const EmailFailedTable = "`email_failed`"
EmailFailedTable is the name of the table in the DB.
const EmailSentTable = "`email_sent`"
EmailSentTable is the name of the table in the DB.
const EmailTable = "`email`"
EmailTable is the name of the table in the DB.
const MigrationsTable = "`migrations`"
MigrationsTable is the name of the table in the DB.
Variables ¶
var EmailFailedFields = []string{"id", "recipient", "subject", "body", "status", "error", "created_at", "sent_at", "retry_count", "retry_error", "retry_at"}
EmailFailedFields is a list of all columns in the DB table.
var EmailFailedPrimaryFields = []string{"id"}
EmailFailedPrimaryFields are the primary key fields in the DB table.
var EmailFields = []string{"id", "recipient", "subject", "body", "status", "error", "created_at", "sent_at", "retry_count", "retry_error", "retry_at"}
EmailFields is a list of all columns in the DB table.
var EmailPrimaryFields = []string{"id"}
EmailPrimaryFields are the primary key fields in the DB table.
var EmailSentFields = []string{"id", "recipient", "subject", "body", "status", "error", "created_at", "sent_at", "retry_count", "retry_error", "retry_at"}
EmailSentFields is a list of all columns in the DB table.
var EmailSentPrimaryFields = []string{"id"}
EmailSentPrimaryFields are the primary key fields in the DB table.
var MigrationsFields = []string{"project", "filename", "statement_index", "status"}
MigrationsFields is a list of all columns in the DB table.
var MigrationsPrimaryFields = []string{"project"}
MigrationsPrimaryFields are the primary key fields in the DB table.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
// ID
ID string `db:"id"`
// Recipient
Recipient string `db:"recipient"`
// Subject
Subject string `db:"subject"`
// Body
Body string `db:"body"`
// Status
Status string `db:"status"`
// Error
Error string `db:"error"`
// Created At
CreatedAt *time.Time `db:"created_at"`
// Sent At
SentAt *time.Time `db:"sent_at"`
// Retry Count
RetryCount int64 `db:"retry_count"`
// Retry Error
RetryError string `db:"retry_error"`
// Retry At
RetryAt *time.Time `db:"retry_at"`
}
Email generated for db table `email`.
func (*Email) Delete ¶
func (e *Email) Delete(opts ...QueryOption) string
func (*Email) GetCreatedAt ¶
GetCreatedAt will return the value of CreatedAt.
func (*Email) GetRecipient ¶
GetRecipient will return the value of Recipient.
func (*Email) GetRetryAt ¶
GetRetryAt will return the value of RetryAt.
func (*Email) GetRetryCount ¶
GetRetryCount will return the value of RetryCount.
func (*Email) GetRetryError ¶
GetRetryError will return the value of RetryError.
func (*Email) GetSubject ¶
GetSubject will return the value of Subject.
func (*Email) Insert ¶
func (e *Email) Insert(opts ...QueryOption) string
func (*Email) Select ¶
func (e *Email) Select(opts ...QueryOption) string
func (*Email) SetCreatedAt ¶
SetCreatedAt sets CreatedAt to the provided value.
func (*Email) SetRetryAt ¶
SetRetryAt sets RetryAt to the provided value.
func (*Email) Update ¶
func (e *Email) Update(opts ...QueryOption) string
type EmailFailed ¶
type EmailFailed struct {
// ID
ID string `db:"id"`
// Recipient
Recipient string `db:"recipient"`
// Subject
Subject string `db:"subject"`
// Body
Body string `db:"body"`
// Status
Status string `db:"status"`
// Error
Error string `db:"error"`
// Created At
CreatedAt *time.Time `db:"created_at"`
// Sent At
SentAt *time.Time `db:"sent_at"`
// Retry Count
RetryCount int64 `db:"retry_count"`
// Retry Error
RetryError string `db:"retry_error"`
// Retry At
RetryAt *time.Time `db:"retry_at"`
}
EmailFailed generated for db table `email_failed`.
func (*EmailFailed) Delete ¶
func (e *EmailFailed) Delete(opts ...QueryOption) string
func (*EmailFailed) GetBody ¶
func (e *EmailFailed) GetBody() string
GetBody will return the value of Body.
func (*EmailFailed) GetCreatedAt ¶
func (e *EmailFailed) GetCreatedAt() *time.Time
GetCreatedAt will return the value of CreatedAt.
func (*EmailFailed) GetError ¶
func (e *EmailFailed) GetError() string
GetError will return the value of Error.
func (*EmailFailed) GetRecipient ¶
func (e *EmailFailed) GetRecipient() string
GetRecipient will return the value of Recipient.
func (*EmailFailed) GetRetryAt ¶
func (e *EmailFailed) GetRetryAt() *time.Time
GetRetryAt will return the value of RetryAt.
func (*EmailFailed) GetRetryCount ¶
func (e *EmailFailed) GetRetryCount() int64
GetRetryCount will return the value of RetryCount.
func (*EmailFailed) GetRetryError ¶
func (e *EmailFailed) GetRetryError() string
GetRetryError will return the value of RetryError.
func (*EmailFailed) GetSentAt ¶
func (e *EmailFailed) GetSentAt() *time.Time
GetSentAt will return the value of SentAt.
func (*EmailFailed) GetStatus ¶
func (e *EmailFailed) GetStatus() string
GetStatus will return the value of Status.
func (*EmailFailed) GetSubject ¶
func (e *EmailFailed) GetSubject() string
GetSubject will return the value of Subject.
func (*EmailFailed) Insert ¶
func (e *EmailFailed) Insert(opts ...QueryOption) string
func (*EmailFailed) Select ¶
func (e *EmailFailed) Select(opts ...QueryOption) string
func (*EmailFailed) SetCreatedAt ¶
func (e *EmailFailed) SetCreatedAt(stamp time.Time)
SetCreatedAt sets CreatedAt to the provided value.
func (*EmailFailed) SetRetryAt ¶
func (e *EmailFailed) SetRetryAt(stamp time.Time)
SetRetryAt sets RetryAt to the provided value.
func (*EmailFailed) SetSentAt ¶
func (e *EmailFailed) SetSentAt(stamp time.Time)
SetSentAt sets SentAt to the provided value.
func (*EmailFailed) Update ¶
func (e *EmailFailed) Update(opts ...QueryOption) string
type EmailSent ¶
type EmailSent struct {
// ID
ID string `db:"id"`
// Recipient
Recipient string `db:"recipient"`
// Subject
Subject string `db:"subject"`
// Body
Body string `db:"body"`
// Status
Status string `db:"status"`
// Error
Error string `db:"error"`
// Created At
CreatedAt *time.Time `db:"created_at"`
// Sent At
SentAt *time.Time `db:"sent_at"`
// Retry Count
RetryCount int64 `db:"retry_count"`
// Retry Error
RetryError string `db:"retry_error"`
// Retry At
RetryAt *time.Time `db:"retry_at"`
}
EmailSent generated for db table `email_sent`.
func (*EmailSent) Delete ¶
func (e *EmailSent) Delete(opts ...QueryOption) string
func (*EmailSent) GetCreatedAt ¶
GetCreatedAt will return the value of CreatedAt.
func (*EmailSent) GetRecipient ¶
GetRecipient will return the value of Recipient.
func (*EmailSent) GetRetryAt ¶
GetRetryAt will return the value of RetryAt.
func (*EmailSent) GetRetryCount ¶
GetRetryCount will return the value of RetryCount.
func (*EmailSent) GetRetryError ¶
GetRetryError will return the value of RetryError.
func (*EmailSent) GetSubject ¶
GetSubject will return the value of Subject.
func (*EmailSent) Insert ¶
func (e *EmailSent) Insert(opts ...QueryOption) string
func (*EmailSent) Select ¶
func (e *EmailSent) Select(opts ...QueryOption) string
func (*EmailSent) SetCreatedAt ¶
SetCreatedAt sets CreatedAt to the provided value.
func (*EmailSent) SetRetryAt ¶
SetRetryAt sets RetryAt to the provided value.
func (*EmailSent) Update ¶
func (e *EmailSent) Update(opts ...QueryOption) string
type Migrations ¶
type Migrations struct {
// Project
Project string `db:"project"`
// Filename
Filename string `db:"filename"`
// Statement Index
StatementIndex int64 `db:"statement_index"`
// Status
Status string `db:"status"`
}
Migrations generated for db table `migrations`.
func (*Migrations) Delete ¶
func (m *Migrations) Delete(opts ...QueryOption) string
func (*Migrations) GetFilename ¶
func (m *Migrations) GetFilename() string
GetFilename will return the value of Filename.
func (*Migrations) GetProject ¶
func (m *Migrations) GetProject() string
GetProject will return the value of Project.
func (*Migrations) GetStatementIndex ¶
func (m *Migrations) GetStatementIndex() int64
GetStatementIndex will return the value of StatementIndex.
func (*Migrations) GetStatus ¶
func (m *Migrations) GetStatus() string
GetStatus will return the value of Status.
func (*Migrations) Insert ¶
func (m *Migrations) Insert(opts ...QueryOption) string
func (*Migrations) Select ¶
func (m *Migrations) Select(opts ...QueryOption) string
func (*Migrations) Update ¶
func (m *Migrations) Update(opts ...QueryOption) string
type QueryConfig ¶
type QueryConfig struct {
Table string
Columns []string
Where string
OrderBy string
LimitStart int
LimitOffset int
Statement string
}
func (*QueryConfig) Apply ¶
func (q *QueryConfig) Apply(opts ...QueryOption) *QueryConfig
func (*QueryConfig) WithColumns ¶
func (q *QueryConfig) WithColumns(cols []string) QueryOption
func (*QueryConfig) WithLimit ¶
func (q *QueryConfig) WithLimit(start, offset int) QueryOption
func (*QueryConfig) WithOrderBy ¶
func (q *QueryConfig) WithOrderBy(clause string) QueryOption
func (*QueryConfig) WithStatement ¶
func (q *QueryConfig) WithStatement(stmt string) QueryOption
func (*QueryConfig) WithTable ¶
func (q *QueryConfig) WithTable(name string) QueryOption
func (*QueryConfig) WithWhere ¶
func (q *QueryConfig) WithWhere(clause string) QueryOption
type QueryOption ¶
type QueryOption interface {
WithTable(name string) QueryOption
WithColumns(cols []string) QueryOption
WithWhere(clause string) QueryOption
WithOrderBy(clause string) QueryOption
WithLimit(start, offset int) QueryOption
WithStatement(stmt string) QueryOption
}
func WithColumns ¶
func WithColumns(cols []string) QueryOption
func WithLimit ¶
func WithLimit(start, offset int) QueryOption
func WithOrderBy ¶
func WithOrderBy(clause string) QueryOption
func WithStatement ¶
func WithStatement(stmt string) QueryOption
func WithTable ¶
func WithTable(name string) QueryOption
func WithWhere ¶
func WithWhere(clause string) QueryOption