model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending = "pending"
	StatusSent    = "sent"
	StatusFailed  = "failed"
)

Status constants

View Source
const EmailFailedTable = "`email_failed`"

EmailFailedTable is the name of the table in the DB.

View Source
const EmailSentTable = "`email_sent`"

EmailSentTable is the name of the table in the DB.

View Source
const EmailTable = "`email`"

EmailTable is the name of the table in the DB.

View Source
const MigrationsTable = "`migrations`"

MigrationsTable is the name of the table in the DB.

Variables

View Source
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.

View Source
var EmailFailedPrimaryFields = []string{"id"}

EmailFailedPrimaryFields are the primary key fields in the DB table.

View Source
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.

View Source
var EmailPrimaryFields = []string{"id"}

EmailPrimaryFields are the primary key fields in the DB table.

View Source
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.

View Source
var EmailSentPrimaryFields = []string{"id"}

EmailSentPrimaryFields are the primary key fields in the DB table.

View Source
var MigrationsFields = []string{"project", "filename", "statement_index", "status"}

MigrationsFields is a list of all columns in the DB table.

View Source
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 NewEmail

func NewEmail(recipient, subject, body string) *Email

NewEmail creates a new email

func (*Email) Delete

func (e *Email) Delete(opts ...QueryOption) string

func (*Email) GetBody

func (e *Email) GetBody() string

GetBody will return the value of Body.

func (*Email) GetCreatedAt

func (e *Email) GetCreatedAt() *time.Time

GetCreatedAt will return the value of CreatedAt.

func (*Email) GetError

func (e *Email) GetError() string

GetError will return the value of Error.

func (*Email) GetID

func (e *Email) GetID() string

GetID will return the value of ID.

func (*Email) GetRecipient

func (e *Email) GetRecipient() string

GetRecipient will return the value of Recipient.

func (*Email) GetRetryAt

func (e *Email) GetRetryAt() *time.Time

GetRetryAt will return the value of RetryAt.

func (*Email) GetRetryCount

func (e *Email) GetRetryCount() int64

GetRetryCount will return the value of RetryCount.

func (*Email) GetRetryError

func (e *Email) GetRetryError() string

GetRetryError will return the value of RetryError.

func (*Email) GetSentAt

func (e *Email) GetSentAt() *time.Time

GetSentAt will return the value of SentAt.

func (*Email) GetStatus

func (e *Email) GetStatus() string

GetStatus will return the value of Status.

func (*Email) GetSubject

func (e *Email) GetSubject() string

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

func (e *Email) SetCreatedAt(stamp time.Time)

SetCreatedAt sets CreatedAt to the provided value.

func (*Email) SetRetryAt

func (e *Email) SetRetryAt(stamp time.Time)

SetRetryAt sets RetryAt to the provided value.

func (*Email) SetSentAt

func (e *Email) SetSentAt(stamp time.Time)

SetSentAt sets SentAt 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) GetID

func (e *EmailFailed) GetID() string

GetID will return the value of ID.

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) GetBody

func (e *EmailSent) GetBody() string

GetBody will return the value of Body.

func (*EmailSent) GetCreatedAt

func (e *EmailSent) GetCreatedAt() *time.Time

GetCreatedAt will return the value of CreatedAt.

func (*EmailSent) GetError

func (e *EmailSent) GetError() string

GetError will return the value of Error.

func (*EmailSent) GetID

func (e *EmailSent) GetID() string

GetID will return the value of ID.

func (*EmailSent) GetRecipient

func (e *EmailSent) GetRecipient() string

GetRecipient will return the value of Recipient.

func (*EmailSent) GetRetryAt

func (e *EmailSent) GetRetryAt() *time.Time

GetRetryAt will return the value of RetryAt.

func (*EmailSent) GetRetryCount

func (e *EmailSent) GetRetryCount() int64

GetRetryCount will return the value of RetryCount.

func (*EmailSent) GetRetryError

func (e *EmailSent) GetRetryError() string

GetRetryError will return the value of RetryError.

func (*EmailSent) GetSentAt

func (e *EmailSent) GetSentAt() *time.Time

GetSentAt will return the value of SentAt.

func (*EmailSent) GetStatus

func (e *EmailSent) GetStatus() string

GetStatus will return the value of Status.

func (*EmailSent) GetSubject

func (e *EmailSent) GetSubject() string

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

func (e *EmailSent) SetCreatedAt(stamp time.Time)

SetCreatedAt sets CreatedAt to the provided value.

func (*EmailSent) SetRetryAt

func (e *EmailSent) SetRetryAt(stamp time.Time)

SetRetryAt sets RetryAt to the provided value.

func (*EmailSent) SetSentAt

func (e *EmailSent) SetSentAt(stamp time.Time)

SetSentAt sets SentAt 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

Jump to

Keyboard shortcuts

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