models

package
v0.0.0-...-4877afc Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultOVConfig

func CreateDefaultOVConfig(configDir string, ovConfigPath string)

func CreateDefaultUsers

func CreateDefaultUsers()

func InitDB

func InitDB()

Types

type OVConfig

type OVConfig struct {
	Id      int
	Profile string `orm:"size(64);unique" valid:"Required;"`
	config.Config
}

OVConfig holds values for OpenVPN config file

func (*OVConfig) Delete

func (c *OVConfig) Delete() error

Delete wrapper

func (*OVConfig) Insert

func (c *OVConfig) Insert() error

Insert wrapper

func (*OVConfig) Read

func (c *OVConfig) Read(fields ...string) error

Read wrapper

func (*OVConfig) Update

func (c *OVConfig) Update(fields ...string) error

Update wrapper

type Settings

type Settings struct {
	Id      int64
	Profile string `orm:"size(64);unique" form:"Profile" valid:"Required;"`

	MIAddress string `orm:"size(64);unique" form:"MIAddress" valid:"Required;"`
	MINetwork string `orm:"size(64);unique" form:"MINetwork" valid:"Required;"`

	OVConfigPath string `orm:"size(64);unique" form:"OVConfigPath" valid:"Required;"`

	ServerAddress string `orm:"size(64);unique" form:"ServerAddress" valid:"Required;"`
	ServerPort    int    `orm:"" form:"ServerPort" valid:"Required;"`

	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

func CreateDefaultSettings

func CreateDefaultSettings() (*Settings, error)

func (*Settings) Delete

func (s *Settings) Delete() error

Delete wrapper

func (*Settings) Insert

func (s *Settings) Insert() error

Insert wrapper

func (*Settings) Read

func (s *Settings) Read(fields ...string) error

Read wrapper

func (*Settings) Update

func (s *Settings) Update(fields ...string) error

Update wrapper

type User

type User struct {
	Id            int64
	Login         string    `orm:"size(64);unique" form:"Login" valid:"Required;"`
	Name          string    `orm:"size(64);unique" form:"Name" valid:"Required;"`
	Email         string    `orm:"size(64);unique" form:"Email" valid:"Required;Email"`
	Password      string    `orm:"size(32)" form:"Password" valid:"Required;MinSize(6)"`
	Repassword    string    `orm:"-" form:"Repassword" valid:"Required"`
	Lastlogintime time.Time `orm:"type(datetime);null" form:"-"`
	Created       time.Time `orm:"auto_now_add;type(datetime)"`
	Updated       time.Time `orm:"auto_now;type(datetime)"`
}

func (*User) Delete

func (u *User) Delete() error

Delete wrapper

func (*User) Insert

func (u *User) Insert() error

func (*User) Read

func (u *User) Read(fields ...string) error

Read wrapper

func (*User) Update

func (u *User) Update(fields ...string) error

Update wrapper

func (*User) Valid

func (u *User) Valid(v *validation.Validation)

Jump to

Keyboard shortcuts

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