models

package
v0.0.0-...-08a7c71 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DOMAIN_SELECT = "SELECT id, domain, UNIX_TIMESTAMP(created_at) as createdat from domains"

Variables

View Source
var SELECT_INBOX = "" /* 156-byte string literal not displayed */

Functions

func InsertDomain

func InsertDomain(db *sqlx.DB, domain string, userId int) string

func InsertUser

func InsertUser(db *sqlx.DB, u *User) string

func ReadEmailBody

func ReadEmailBody(s string) (string, string)

Types

type Domain

type Domain struct {
	Id        int    `json:"id"`
	Domain    string `json:"domain"`
	CreatedAt int64  `json:"created_at"`
	Hits      []string
	Referers  []string
	Emails    int
}

func SelectDomains

func SelectDomains(db *sqlx.DB, userId int) ([]*Domain, string)

type Inbox

type Inbox struct {
	Id          int    `json:"id"`
	SentTo      string `json:"sent_to"`
	SentFrom    string `json:"sent_from"`
	Body        string `json:"body"`
	Subject     string `json:"subject"`
	CreatedAt   int64  `json:"created_at"`
	MessageText template.HTML
	MessageHTML template.HTML
}

func SelectInboxByDomain

func SelectInboxByDomain(db *sqlx.DB, domain string) ([]Inbox, string)

func SelectInboxes

func SelectInboxes(db *sqlx.DB) ([]Inbox, string)

type User

type User struct {
	Id        int    `json:"id"`
	Email     string `json:"email"`
	Flavor    string `json:"flavor"`
	Phrase    string
	CreatedAt int64 `json:"created_at"`
}

func DecodeUser

func DecodeUser(s string) *User

func SelectUsers

func SelectUsers(db *sqlx.DB) ([]User, string)

func (*User) Encode

func (u *User) Encode() string

Jump to

Keyboard shortcuts

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