models

package
v0.9.17 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewDomain

func AddNewDomain(domain string, username string, password string) (result bool, err error)

func AddNewUser

func AddNewUser(data Users) (result bool, err error)

func ChangePassword

func ChangePassword(data Users)

func DeleteDomain

func DeleteDomain(domain string)

func DeleteUser

func DeleteUser(userName string)

Types

type Domains

type Domains struct {
	Id         uint64 `db:"id" json:"id" form:"id"`
	Name       string `db:"name" json:"name" form:"name" validation:"required"`
	UsersCount uint64 `db:"users_count" json:"users_count"`
}

func GetDomains

func GetDomains() (result []Domains)

Get All domains orderder by id DESC with users count

type Export

type Export struct {
	Accounts   []ExportUsers `json:"accounts"`
	Dkim       ExportDKIM    `json:"dkim"`
	DomainName string        `json:"domainName"`
	GenTime    string        `json:"generatedAt"`
	Filename   string        `json:"export_filename"`
}

func ExportToFile

func ExportToFile(domain string) (filename string, export_data Export, err error)

type ExportDKIM

type ExportDKIM struct {
	Public  string `json:"public"`
	Private string `json:"private"`
}

type ExportUsers

type ExportUsers struct {
	Email    string `db:"email" json:"email"`
	Password string `db:"password" json:"password"`
}

type Users

type Users struct {
	Id                  uint64 `db:"id" json:"id" form:"id"`
	DomainID            uint64 `db:"domain_id" json:"domain_id" form:"domain_id" validation:"required"`
	Password            string `db:"password" json:"-" form:"password" validation:"required"`
	PasswordIsEncrypted string `form:"is_encrypted" json:"-"`
	Email               string `db:"email" json:"email" form:"email" validation:"email,required"`
}

func GetAllUsers

func GetAllUsers(domain_id uint64) (result []Users)

func (Users) GenEncryptedPassword

func (data Users) GenEncryptedPassword() string

Jump to

Keyboard shortcuts

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