models

package
v0.0.0-...-82932a5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSMTPAccount

func AddSMTPAccount(smtpAccount SMTPAccount) (int, error)

AddSMTPAccount xxx

func CloseDB

func CloseDB()

CloseDB closes database connection (unnecessary)

func GetAllSMTPAccount

func GetAllSMTPAccount() (*[]SMTPAccount, error)

GetAllSMTPAccount xxx

func RestSMTPQuota

func RestSMTPQuota() error

RestSMTPQuota xxx

func Setup

func Setup()

Setup initializes the database instance

Types

type Model

type Model struct {
	ID        int `gorm:"primary_key" json:"id"`
	CreatedAt int `json:"created_at"`
	UpdatedAt int `json:"updated_at"`
}

Model base fields

type SMTPAccount

type SMTPAccount struct {
	Model

	Host           string `json:"host" gorm:"uniqueIndex:idx_host_username;size:100;not null"`
	Username       string `json:"username" gorm:"uniqueIndex:idx_host_username;size:100;not null"`
	Password       string `json:"password" gorm:"size:100;not null"`
	TodayUsedQuota int    `json:"today_used_quota"`
	QuotaPerDay    int    `json:"quote_per_day"`
}

SMTPAccount aoocunt details

func GetAvailabeSMTPAccount

func GetAvailabeSMTPAccount() (*SMTPAccount, error)

GetAvailabeSMTPAccount get available smtp account which still has quota today

func GetSMTPAccountByID

func GetSMTPAccountByID(id int) (*SMTPAccount, error)

GetSMTPAccountByID xx

func (*SMTPAccount) IncreaseTodayUsedQouta

func (smtpAccount *SMTPAccount) IncreaseTodayUsedQouta() error

IncreaseTodayUsedQouta xxx

Jump to

Keyboard shortcuts

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