model

package
v0.0.0-...-021aec9 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	gorm.Model
	Name          string
	RealName      string
	Password      string
	Quota         int
	Status        int
	DomainID      uint
	Autoresponder Autoresponder
	Forward       string
}

type Autoresponder

type Autoresponder struct {
	gorm.Model
	Enabled   bool
	Subject   string
	Message   string
	StartDate string
	EndDate   string
	AccountID uint
}

type Container

type Container struct {
	ID      string
	Name    string
	Image   string
	Command string
	Status  string
	Ports   string
}

type Database

type Database struct {
	gorm.Model
	Name                 string
	Status               int
	DatabaseAssociations []DatabaseAssociation
	IPs                  []IP
}

type DatabaseAssociation

type DatabaseAssociation struct {
	gorm.Model
	DatabaseID     uint
	DatabaseUserID uint
	// 1: add 2: ok 3: del
	Status int
}

type DatabaseUser

type DatabaseUser struct {
	gorm.Model
	Name                 string
	Password             string
	DatabaseAssociations []DatabaseAssociation
	// 1: enabled 2: disabled
	Status int
}

type Domain

type Domain struct {
	gorm.Model
	Name           string
	Status         int
	SpamFilter     string
	DefaultAccount string
	Accounts       []Account
	Lists          []List
}

type FTPUser

type FTPUser struct {
	gorm.Model
	Name     string
	Password string
	Status   int
	WebID    uint
}

type FtpConfig

type FtpConfig struct {
	gorm.Model
	AnonWrite int
	AnonRead  int
	Status    int
}

type IP

type IP struct {
	gorm.Model
	Value      string
	DatabaseID uint
	// 1: enabled 2: disabled
	Status int
}

type List

type List struct {
	gorm.Model
	Name       string
	AdminEmail string
	Password   string
	Status     int
	DomainID   uint
}

type Manager

type Manager interface {
	AddWeb(web *Web) error
	CheckIfWebExists(domain string) bool
	GetAllWebs() []Web
	RemoveWeb(id string) (err error)
	UpdateWeb(web *Web) (err error)
	GetWeb(id string) Web

	GetUser(email string) User
	UpdatePassword(user string, hash string) (err error)

	AddZone(zone *Zone) error
	CheckIfZoneExists(domain string) bool
	GetAllZones() []Zone
	RemoveZone(id string) (err error)
	UpdateZone(zone *Zone) (err error)
	GetZone(id string) Zone

	AddRecords(records []Record)
	GetRecords(zoneid string) []Record
	CheckIfRecordExists(name string, recordtype string, value string, priority string, zoneid string) bool
	GetRecord(id string) Record
	AddRecord(record *Record) (err error)
	UpdateRecord(record *Record) (err error)
	RemoveRecord(id string) (err error)

	AddFTPUser(ftpu *FTPUser) (err error)
	UpdateFTPUser(ftpu *FTPUser) (err error)
	CheckIfFTPUserExists(name string, webid string) bool
	GetAllFTPUsers() []FTPUser
	GetFTPUser(id string) FTPUser
	RemoveFTPUser(id string) (err error)
	UpdateFtpConfig(anonWrite int, anonRead int, status int) (err error)
	GetFtpConfig() FtpConfig

	AddDatabase(db *Database) (err error)
	UpdateDatabase(db *Database) (err error)
	CheckIfDatabaseExists(name string) bool
	GetAllDatabases() []Database
	GetDatabase(id string) Database
	RemoveDatabase(id string) (err error)
	UpdateIP(ip IP, db Database)

	UpdateDatabaseUser(dbu *DatabaseUser) (err error)
	AddDatabaseUser(dbu *DatabaseUser) (err error)
	CheckIfDatabaseUserExists(name string) bool
	GetAllDatabaseUsers() []DatabaseUser
	GetDatabaseUser(id string) DatabaseUser
	RemoveDatabaseUser(id string) (err error)
	RemoveAssociationIP(db *Database, ip *IP) (err error)
	GetUsersOfDatabase(dbid string) []DatabaseUser

	AddDatabaseAssociation(dba *DatabaseAssociation) (err error)
	UpdateDatabaseAssociation(dba *DatabaseAssociation) (err error)
	CheckIfDatabaseAssociationExists(dbid string, dbuserid string) bool
	GetAllDatabaseAssociations() []DatabaseAssociation
	GetDatabaseAssociation(dbid string, dbuserid string) DatabaseAssociation
	RemoveDatabaseAssociation(dba DatabaseAssociation)

	AddDomain(domain *Domain) (err error)
	UpdateDomain(domain *Domain) (err error)
	CheckIfDomainExists(name string) bool
	GetAllDomains() []Domain
	GetDomain(id string) Domain
	RemoveDomain(id string) (err error)

	AddAccount(account *Account) (err error)
	UpdateAccount(account *Account) (err error)
	CheckIfAccountExists(name string, domainid string) bool
	GetAllAccounts() []Account
	GetAccount(id string) Account
	RemoveAccount(id string) (err error)
	GetAccounts(domainid string) []Account

	AddList(list *List) (err error)
	UpdateList(list *List) (err error)
	CheckIfListExists(name string, domainid string) bool
	GetAllLists() []List
	GetList(id string) List
	RemoveList(id string) (err error)
	GetLists(domainid string) []List

	AddAutoresponder(aresponder *Autoresponder) (err error)
	UpdateAutoresponder(aresponder *Autoresponder) (err error)
	CheckIfAutoresponderExists(accountid string) bool
	GetAllAutoresponders() []Autoresponder
	GetAutoresponder(id string) Autoresponder
	RemoveAutoresponder(id string) (err error)
	// contains filtered or unexported methods
}
var Mgr Manager

type Record

type Record struct {
	gorm.Model
	Type     string
	Name     string
	Value    string
	Priority string
	ZoneID   uint
}

type User

type User struct {
	gorm.Model
	Email    string
	Password string
}

type Web

type Web struct {
	gorm.Model
	Domain     string
	CGI        bool
	SSL        bool
	SSLCert    string
	PHP        bool
	PHPVersion string
	PHPMethod  string
	WebServer  string
	Status     int
	FTPUsers   []FTPUser
}

type Zone

type Zone struct {
	gorm.Model
	Domain  string
	Email   string
	Status  int
	Records []Record
}

Jump to

Keyboard shortcuts

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