models

package
v0.0.0-...-66c3b8b Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CreateTableBlock = `` /* 273-byte string literal not displayed */
View Source
const CreateTableEpisode = `` /* 321-byte string literal not displayed */
View Source
const CreateTableFooter = `` /* 192-byte string literal not displayed */
View Source
const CreateTableHeader = `` /* 192-byte string literal not displayed */
View Source
const CreateTableNewsletter = `` /* 201-byte string literal not displayed */
View Source
const CreateTableSubscriber = `` /* 198-byte string literal not displayed */
View Source
const CreateTableSubscription = `` /* 401-byte string literal not displayed */
View Source
const CreateTableUser = `` /* 261-byte string literal not displayed */
View Source
const DeleteTableBlock = `
DROP TABLE IF EXISTS Block;
`
View Source
const DeleteTableEpisode = `
DROP TABLE IF EXISTS Episode;
`
View Source
const DeleteTableFooter = `
DROP TABLE IF EXISTS Footer;
`
View Source
const DeleteTableHeader = `
DROP TABLE IF EXISTS Header;
`
View Source
const DeleteTableNewsletter = `
DROP TABLE IF EXISTS Newsletter;
`
View Source
const DeleteTableSubscriber = `DROP TABLE IF EXISTS Subscriber;`
View Source
const DeleteTableSubscription = `DROP TABLE IF EXISTS Subscription;`
View Source
const DeleteTableUser = `
DROP TABLE IF EXISTS User;
`

Variables

This section is empty.

Functions

func GetBlocks

func GetBlocks(db *sqlx.DB, newsletterId string, episodeID int) (*[]Block, error)

Types

type Block

type Block struct {
	NewsletterID string `db:"NewsletterID" json:"newsletterID"`
	EpisodeID    int    `db:"EpisodeID"    json:"episodeID"`
	BlockID      int    `db:"BlockID"      json:"blockID"`
	Content      string `db:"Content"      json:"content"`
}

type Episode

type Episode struct {
	NewsletterID string    `db:"NewsletterID"    json:"newsletterId"`
	EpisodeID    int       `db:"EpisodeID"      json:"episodeID"`
	CreationDate time.Time `db:"CreationDate"    json:"creationDate"`
	HeaderID     string    `db:"HeaderID"    json:"headerID"`
	FooterID     string    `db:"FooterID"    json:"footerID"`
}

func GetEpisode

func GetEpisode(db *sqlx.DB, newsletterID string, episodeID int) (*Episode, error)
type Footer struct {
	FooterID string `db:"FooterID"     json:"footerID"`
	Content  string `db:"Content"      json:"content"`
}

func GetFooter

func GetFooter(db *sqlx.DB, footerID string) (*Footer, error)
type Header struct {
	HeaderID string `db:"HeaderID"     json:"headerID"`
	Content  string `db:"Content"      json:"content"`
}

func GetHeader

func GetHeader(db *sqlx.DB, headerID string) (*Header, error)

type Newsletter

type Newsletter struct {
	NewsletterID string `db:"NewsletterID"       json:"newsletterId"`
	Name         string `db:"Name"     json:"name"`
}

func GetNewsletter

func GetNewsletter(db *sqlx.DB, newsletterId string) (*Newsletter, error)

type Subscriber

type Subscriber struct {
	SubscriberID string `db:"SubscriberID" json:"subscriberId"`
	Email        string `db:"Email"        json:"email"`
}

func GetSubscriber

func GetSubscriber(db *sqlx.DB, subscriberId string) (*Subscriber, error)

type Subscription

type Subscription struct {
	NewsletterID        string `db:"NewsletterID" json:"newsletterID"`
	SubscriberID        string `db:"SubscriberID" json:"subscriberID"`
	NewsletterShortname string `db:"NewsletterShortname" json:"newsletterShortname"`
	NewsletterKey       string `db:"NewsletterKey" json:"newsletterKey"`
	SubscriberKey       string `db:"SubscriberKey" json:"subscriberKey"`
	StartEpisodeID      int    `db:"StartEpisodeID" json:"startEpisodeID"`
	EndEpisodeID        int    `db:"EndEpisodeID" json:"endEpisodeID"`
}

func GetSubscription

func GetSubscription(db *sqlx.DB, newsletterShortname string, episodeID int, newsletterKey string, subscriberKey string) (*Subscription, error)

type User

type User struct {
	UserID    string `db:"UserID"       json:"userId"`
	LastName  string `db:"LastName"     json:"lastName"`
	FirstName string `db:"FirstName"    json:"firstName"`
	Email     string `db:"Email"        json:"email"`
}

func GetUser

func GetUser(db *sqlx.DB, userId string) (*User, error)

Jump to

Keyboard shortcuts

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