Documentation ¶
Index ¶
- Constants
- func Setup(database *db.DB)
- type Client
- type ClientsRepo
- func (repo ClientsRepo) Find(conn ConnectionInterface, id string) (Client, error)
- func (repo ClientsRepo) FindAll(conn ConnectionInterface) ([]Client, error)
- func (repo ClientsRepo) FindAllByTemplateID(conn ConnectionInterface, templateID string) ([]Client, error)
- func (repo ClientsRepo) Update(conn ConnectionInterface, client Client) (Client, error)
- func (repo ClientsRepo) Upsert(conn ConnectionInterface, client Client) (Client, error)
- type Config
- type ConnectionInterface
- type DatabaseInterface
- type DatabaseMigrator
- type DuplicateError
- type GlobalUnsubscribe
- type GlobalUnsubscribesRepo
- type IDGeneratorFunc
- type IDSet
- type Kind
- type KindsRepo
- func (repo KindsRepo) Find(conn ConnectionInterface, id, clientID string) (Kind, error)
- func (repo KindsRepo) FindAll(conn ConnectionInterface) ([]Kind, error)
- func (repo KindsRepo) FindAllByTemplateID(conn ConnectionInterface, templateID string) ([]Kind, error)
- func (repo KindsRepo) Trim(conn ConnectionInterface, clientID string, kindIDs []string) (int, error)
- func (repo KindsRepo) Update(conn ConnectionInterface, kind Kind) (Kind, error)
- func (repo KindsRepo) Upsert(conn ConnectionInterface, kind Kind) (Kind, error)
- type Message
- type MessagesRepo
- func (repo MessagesRepo) Create(conn ConnectionInterface, message Message) (Message, error)
- func (repo MessagesRepo) DeleteBefore(conn ConnectionInterface, threshold time.Time) (int, error)
- func (repo MessagesRepo) FindByID(conn ConnectionInterface, messageID string) (Message, error)
- func (repo MessagesRepo) Update(conn ConnectionInterface, message Message) (Message, error)
- func (repo MessagesRepo) Upsert(conn ConnectionInterface, message Message) (Message, error)
- type NotFoundError
- type Preference
- type PreferencesRepo
- type Receipt
- type ReceiptsRepo
- type Template
- type TemplateUpdateError
- type TemplatesRepo
- func (repo TemplatesRepo) Create(conn ConnectionInterface, template Template) (Template, error)
- func (repo TemplatesRepo) Destroy(conn ConnectionInterface, templateID string) error
- func (repo TemplatesRepo) FindByID(conn ConnectionInterface, templateID string) (Template, error)
- func (repo TemplatesRepo) ListIDsAndNames(conn ConnectionInterface) ([]Template, error)
- func (repo TemplatesRepo) Update(conn ConnectionInterface, templateID string, template Template) (Template, error)
- type TransactionCommitError
- type Unsubscribe
- type Unsubscribes
- type UnsubscribesRepo
- func (repo UnsubscribesRepo) FindAllByUserID(conn ConnectionInterface, userID string) ([]Unsubscribe, error)
- func (repo UnsubscribesRepo) Get(conn ConnectionInterface, userID, clientID, kindID string) (bool, error)
- func (repo UnsubscribesRepo) Set(conn ConnectionInterface, userID, clientID, kindID string, unsubscribe bool) error
Constants ¶
View Source
const ( DefaultTemplateID = "default" DoNotSetTemplateID = "" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Primary int `db:"primary"` ID string `db:"id"` Description string `db:"description"` CreatedAt time.Time `db:"created_at"` TemplateID string `db:"template_id"` }
func (Client) TemplateToUse ¶
type ClientsRepo ¶
type ClientsRepo struct{}
func NewClientsRepo ¶
func NewClientsRepo() ClientsRepo
func (ClientsRepo) Find ¶
func (repo ClientsRepo) Find(conn ConnectionInterface, id string) (Client, error)
func (ClientsRepo) FindAll ¶
func (repo ClientsRepo) FindAll(conn ConnectionInterface) ([]Client, error)
func (ClientsRepo) FindAllByTemplateID ¶
func (repo ClientsRepo) FindAllByTemplateID(conn ConnectionInterface, templateID string) ([]Client, error)
func (ClientsRepo) Update ¶
func (repo ClientsRepo) Update(conn ConnectionInterface, client Client) (Client, error)
func (ClientsRepo) Upsert ¶
func (repo ClientsRepo) Upsert(conn ConnectionInterface, client Client) (Client, error)
type ConnectionInterface ¶
type ConnectionInterface interface { db.ConnectionInterface }
type DatabaseInterface ¶
type DatabaseInterface interface { db.DatabaseInterface }
func NewDatabase ¶
func NewDatabase(sqlDB *sql.DB, config Config) DatabaseInterface
type DatabaseMigrator ¶
type DatabaseMigrator struct { }
func (DatabaseMigrator) Migrate ¶
func (d DatabaseMigrator) Migrate(db *sql.DB, migrationsPath string)
func (DatabaseMigrator) Seed ¶
func (d DatabaseMigrator) Seed(database DatabaseInterface, defaultTemplatePath string)
type DuplicateError ¶
type DuplicateError struct {
Err error
}
func (DuplicateError) Error ¶
func (e DuplicateError) Error() string
type GlobalUnsubscribe ¶
type GlobalUnsubscribesRepo ¶
type GlobalUnsubscribesRepo struct{}
func NewGlobalUnsubscribesRepo ¶
func NewGlobalUnsubscribesRepo() GlobalUnsubscribesRepo
func (GlobalUnsubscribesRepo) Get ¶
func (repo GlobalUnsubscribesRepo) Get(conn ConnectionInterface, userGUID string) (bool, error)
func (GlobalUnsubscribesRepo) Set ¶
func (repo GlobalUnsubscribesRepo) Set(conn ConnectionInterface, userGUID string, unsubscribe bool) error
type IDGeneratorFunc ¶
type Kind ¶
type Kind struct { Primary int `db:"primary"` ID string `db:"id"` Description string `db:"description"` Critical bool `db:"critical"` ClientID string `db:"client_id"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` TemplateID string `db:"template_id"` }
func (Kind) TemplateToUse ¶
type KindsRepo ¶
type KindsRepo struct{}
func NewKindsRepo ¶
func NewKindsRepo() KindsRepo
func (KindsRepo) Find ¶
func (repo KindsRepo) Find(conn ConnectionInterface, id, clientID string) (Kind, error)
func (KindsRepo) FindAllByTemplateID ¶
func (repo KindsRepo) FindAllByTemplateID(conn ConnectionInterface, templateID string) ([]Kind, error)
type Message ¶
type MessagesRepo ¶
type MessagesRepo struct {
// contains filtered or unexported fields
}
func NewMessagesRepo ¶
func NewMessagesRepo(guidGenerator IDGeneratorFunc) MessagesRepo
func (MessagesRepo) Create ¶
func (repo MessagesRepo) Create(conn ConnectionInterface, message Message) (Message, error)
func (MessagesRepo) DeleteBefore ¶
func (repo MessagesRepo) DeleteBefore(conn ConnectionInterface, threshold time.Time) (int, error)
func (MessagesRepo) FindByID ¶
func (repo MessagesRepo) FindByID(conn ConnectionInterface, messageID string) (Message, error)
func (MessagesRepo) Update ¶
func (repo MessagesRepo) Update(conn ConnectionInterface, message Message) (Message, error)
func (MessagesRepo) Upsert ¶
func (repo MessagesRepo) Upsert(conn ConnectionInterface, message Message) (Message, error)
type NotFoundError ¶
type NotFoundError struct {
Err error
}
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Preference ¶
type PreferencesRepo ¶
type PreferencesRepo struct {
// contains filtered or unexported fields
}
func NewPreferencesRepo ¶
func NewPreferencesRepo() PreferencesRepo
func (PreferencesRepo) FindNonCriticalPreferences ¶
func (repo PreferencesRepo) FindNonCriticalPreferences(conn ConnectionInterface, userGUID string) ([]Preference, error)
type Receipt ¶
type ReceiptsRepo ¶
type ReceiptsRepo struct{}
func NewReceiptsRepo ¶
func NewReceiptsRepo() ReceiptsRepo
func (ReceiptsRepo) CreateReceipts ¶
func (repo ReceiptsRepo) CreateReceipts(conn ConnectionInterface, userGUIDs []string, clientID, kindID string) error
type Template ¶
type Template struct { Primary int `db:"primary"` ID string `db:"id"` Name string `db:"name"` Subject string `db:"subject"` Text string `db:"text"` HTML string `db:"html"` Metadata string `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` Overridden bool `db:"overridden"` }
type TemplateUpdateError ¶
type TemplateUpdateError struct {
Err error
}
func (TemplateUpdateError) Error ¶
func (e TemplateUpdateError) Error() string
type TemplatesRepo ¶
type TemplatesRepo struct{}
func NewTemplatesRepo ¶
func NewTemplatesRepo() TemplatesRepo
func (TemplatesRepo) Create ¶
func (repo TemplatesRepo) Create(conn ConnectionInterface, template Template) (Template, error)
func (TemplatesRepo) Destroy ¶
func (repo TemplatesRepo) Destroy(conn ConnectionInterface, templateID string) error
func (TemplatesRepo) FindByID ¶
func (repo TemplatesRepo) FindByID(conn ConnectionInterface, templateID string) (Template, error)
func (TemplatesRepo) ListIDsAndNames ¶
func (repo TemplatesRepo) ListIDsAndNames(conn ConnectionInterface) ([]Template, error)
func (TemplatesRepo) Update ¶
func (repo TemplatesRepo) Update(conn ConnectionInterface, templateID string, template Template) (Template, error)
type TransactionCommitError ¶
type TransactionCommitError struct {
Err error
}
func (TransactionCommitError) Error ¶
func (e TransactionCommitError) Error() string
type Unsubscribe ¶
type Unsubscribe struct { Primary int `db:"primary"` UserID string `db:"user_id"` ClientID string `db:"client_id"` KindID string `db:"kind_id"` CreatedAt time.Time `db:"created_at"` }
func (*Unsubscribe) PreInsert ¶
func (u *Unsubscribe) PreInsert(s gorp.SqlExecutor) error
type Unsubscribes ¶
type Unsubscribes []Unsubscribe
func (Unsubscribes) Contains ¶
func (unsubscribes Unsubscribes) Contains(clientID, kindID string) bool
type UnsubscribesRepo ¶
type UnsubscribesRepo struct{}
func NewUnsubscribesRepo ¶
func NewUnsubscribesRepo() UnsubscribesRepo
func (UnsubscribesRepo) FindAllByUserID ¶
func (repo UnsubscribesRepo) FindAllByUserID(conn ConnectionInterface, userID string) ([]Unsubscribe, error)
func (UnsubscribesRepo) Get ¶
func (repo UnsubscribesRepo) Get(conn ConnectionInterface, userID, clientID, kindID string) (bool, error)
func (UnsubscribesRepo) Set ¶
func (repo UnsubscribesRepo) Set(conn ConnectionInterface, userID, clientID, kindID string, unsubscribe bool) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.