mmysql

package
v0.0.0-...-074395f Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	gorm.Model
	UserUUID string       `json:"user_uuid" gorm:"user_uuid"`
	Name     string       `json:"name"`
	ServerID uint64       `json:"server_id"`
	UUID     string       `json:"uuid" gorm:"column:uuid"`
	Port     int          `json:"port"`
	Expire   int          `json:"expire"` // 过期时间:天
	Relay    Relays       `json:"relay"`
	Server   ServerAttr   `json:"server"`
	Target   ClientTarget `json:"target"`
	CaPem    string       `json:"ca_pem"`
	CertPem  string       `json:"cert_pem"`
	KeyPem   string       `json:"key_pem"`
}

func (Client) TableName

func (Client) TableName() string

type ClientAttrs

type ClientAttrs struct {
	Type   string       `json:"type"`
	Name   string       `json:"name"`
	UUID   string       `json:"uuid"`
	Port   int          `json:"port"`
	Relay  []RelayAttrs `json:"relay"`
	Server ServerAttr   `json:"server"`
	Target ClientTarget `json:"target"`
}

type ClientTarget

type ClientTarget struct {
	Host string `json:"host" binding:"required"`
	Port int    `json:"port" binding:"required"`
}

func (*ClientTarget) Scan

func (c *ClientTarget) Scan(input interface{}) error

func (ClientTarget) Value

func (c ClientTarget) Value() (driver.Value, error)

type Relay

type Relay struct {
	gorm.Model
	UserUUID string `json:"user_uuid" gorm:"user_uuid"`
	Name     string `json:"name"`
	UUID     string `json:"uuid" gorm:"column:uuid"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	OutPort  int    `json:"out_port"`
	CaPem    string `json:"ca_pem"`
	CertPem  string `json:"cert_pem"`
	KeyPem   string `json:"key_pem"`
}

func (Relay) TableName

func (Relay) TableName() string

type RelayAttrs

type RelayAttrs struct {
	Name    string `json:"name"`
	UUID    string `json:"uuid"`
	Host    string `json:"host"`
	Port    int    `json:"port"`
	OutPort int    `json:"out_port"`
	Sort    int    `json:"sort"`
}

type Relays

type Relays []RelayAttrs

func (*Relays) Scan

func (c *Relays) Scan(input interface{}) error

func (Relays) Value

func (c Relays) Value() (driver.Value, error)

type Resource

type Resource struct {
	gorm.Model
	Name     string `json:"name"`
	UUID     string `json:"uuid" gorm:"column:uuid"`
	UserUUID string `json:"user_uuid" gorm:"user_uuid"`
	Type     string `json:"type"`
	Host     string `json:"host"`                    // api.github.com
	Port     string `json:"port" gorm:"column:port"` // 80-443;3306;6379
}

func (Resource) TableName

func (Resource) TableName() string

type Server

type Server struct {
	gorm.Model
	ResourceID string `json:"resource_id"`
	UserUUID   string `json:"user_uuid" gorm:"user_uuid"`
	Name       string `json:"name"`
	UUID       string `json:"uuid" gorm:"column:uuid"`
	Host       string `json:"host"`
	Port       int    `json:"port"`
	OutPort    int    `json:"out_port"`
	CaPem      string `json:"ca_pem"`
	CertPem    string `json:"cert_pem"`
	KeyPem     string `json:"key_pem"`
}

func (Server) TableName

func (Server) TableName() string

type ServerAttr

type ServerAttr struct {
	Name    string `json:"name"`
	UUID    string `json:"uuid"`
	Host    string `json:"host"`
	Port    int    `json:"port"`
	OutPort int    `json:"out_port"`
}

func (*ServerAttr) Scan

func (c *ServerAttr) Scan(input interface{}) error

func (ServerAttr) Value

func (c ServerAttr) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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