Documentation ¶
Index ¶
- Variables
- func DeleteClient(id uint) error
- func DeleteTask(id uint) error
- func DeleteTaskByClientId(clientId uint) error
- func Init() error
- func UpdateClientActive(id uint, active bool) error
- func UpdateClientOffline(id uint) error
- func UpdateClientOnline(client *Client) error
- func UpdateTaskActive(id uint, active bool) error
- func UpdateTaskCompress(id uint, compress bool) error
- func UpdateTaskTraffic(id uint, in, out uint) error
- func Wrap(err error) error
- type Client
- type Size
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRows = errors.New("record not found") ErrConflict = errors.New("record conflict") )
Functions ¶
func DeleteClient ¶
func DeleteTask ¶
func DeleteTaskByClientId ¶ added in v1.4.0
func UpdateClientActive ¶
func UpdateClientOffline ¶ added in v1.3.0
func UpdateClientOnline ¶
func UpdateTaskActive ¶
func UpdateTaskCompress ¶ added in v1.5.0
func UpdateTaskTraffic ¶ added in v1.8.0
Types ¶
type Client ¶
type Client struct { Id uint `json:"id" gorm:"primaryKey,autoIncrement"` Name string `json:"name"` Key string `json:"key" gorm:"uniqueIndex"` Ver string `json:"ver"` Active bool `json:"active" gorm:"default:true"` Online bool `json:"online"` Addr string `json:"addr"` GO string `json:"go"` OS string `json:"os"` ARCH string `json:"arch"` Hostname string `json:"hostname"` LastOnlineAt time.Time `json:"last_online_at"` CreateAt time.Time `json:"create_at" gorm:"autoCreateTime:milli"` UpdateAt time.Time `json:"update_at" gorm:"autoUpdateTime:milli"` }
func CreateClient ¶
func GetClientById ¶
func GetClientByKey ¶
func ListClient ¶
func UpdateClient ¶
type Task ¶
type Task struct { Id uint `json:"id" gorm:"primaryKey,autoIncrement"` ClientId uint `json:"client_id"` Name string `json:"name"` Secret string `json:"secret" gorm:"uniqueIndex"` Addr string `json:"addr"` Active bool `json:"active" gorm:"default:true"` Compress bool `json:"compress"` TrafficIn Size `json:"traffic_in" gorm:"default:0"` TrafficOut Size `json:"traffic_out" gorm:"default:0"` CreateAt time.Time `json:"create_at" gorm:"autoCreateTime:milli"` UpdateAt time.Time `json:"update_at" gorm:"autoUpdateTime:milli"` }
func CreateTask ¶
func GetTaskById ¶
func ListTaskByClientId ¶
func UpdateTask ¶
Click to show internal directories.
Click to hide internal directories.