models

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MODE_LOCAL  = "local"
	MODE_REMOTE = "remote"
	MODE_DOMAIN = "domain"
)
View Source
const DOMAIN_TABLE_NAME = "domains"
View Source
const PROXY_TABLE_NAME = "proxys"
View Source
const REMOTE_TABLE_NAME = "remotes"
View Source
const USER_TABLE_NAME = "users"

Variables

This section is empty.

Functions

func DoaminUpdate

func DoaminUpdate(tag string, update func(u *Domain)) error

func Init

func Init(c db.Connection)

func ProxyUpdate

func ProxyUpdate(tag string, update func(u *Proxy)) error

func RemoteUpdate

func RemoteUpdate(tag string, update func(u *Remote)) error

func UserUpdate

func UserUpdate(name string, update func(u *User)) error

Types

type Domain

type Domain struct {
	ID      int    `gorm:"column:id"`
	Tag     string `gorm:"column:tag"`
	Domains string `gorm:"column:domains"`
	Enable  int    `gorm:"column:enable"`
}

func DomainFind

func DomainFind(tag string) *Domain

func DomainGet

func DomainGet() []Domain

type Proxy

type Proxy struct {
	ID       int    `gorm:"column:id"`
	Tag      string `gorm:"column:tag"`
	Enable   int    `gorm:"column:enable"`
	Iface    string `gorm:"column:interface"`
	Port     int    `gorm:"column:port"`
	Auth     int    `gorm:"column:auth"`
	Protocal string `gorm:"column:protocal"`
	Remote   string `gorm:"column:remote"`
	Mode     string `gorm:"column:mode"`
	Status   string `gorm:"column:status"`
}

func ProxyFind

func ProxyFind(tag string) *Proxy

func ProxyFindByID

func ProxyFindByID(id string) *Proxy

func ProxyGet

func ProxyGet() []Proxy

type Remote

type Remote struct {
	ID       int    `gorm:"column:id"`
	Tag      string `gorm:"column:tag"`
	Enable   int    `gorm:"column:enable"`
	Address  string `gorm:"column:address"`
	Auth     int    `gorm:"column:auth"`
	User     string `gorm:"column:user"`
	Password string `gorm:"column:password"`
	Protocal string `gorm:"column:protocal"`
	Status   string `gorm:"column:status"`
}

func RemoteFind

func RemoteFind(tag string) *Remote

func RemoteGet

func RemoteGet() []Remote

type User

type User struct {
	ID       int    `gorm:"column:id"`
	User     string `gorm:"column:user"`
	Password string `gorm:"column:password"`
	Enable   int    `gorm:"column:enable"`
	Flow     int    `gorm:"column:flow"`
	Online   int    `gorm:"column:online"`
}

func UserFind

func UserFind(name string) *User

func UserGet

func UserGet() []User

Jump to

Keyboard shortcuts

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