Versions in this module Expand all Collapse all v0 v0.1.1 Jul 21, 2018 v0.1.0 Jan 6, 2018 Changes in this version + func IsExist(err error) bool + func IsNotExist(err error) bool + type Agent struct + CreatedAt time.Time + Delayed string + Device string + Hash string + ID int + Status string + Tag string + Tunnels []Tunnel + UpdatedAt time.Time + UserID int + Version string + func (agent Agent) MarshalJSON() ([]byte, error) + type AgentForJSON Agent + type DB struct + func New(datadir string) (*DB, error) + func (db *DB) CreateAgent(username, hash, tag string) error + func (db *DB) CreateTunnel(username, ahash, hash, proto, exportAddr, serverAddr, tag string) error + func (db *DB) CreateUser(name, password, email string, isAdmin bool) error + func (db *DB) DeleteAgent(username, hash string) error + func (db *DB) DeleteAgents(username string) error + func (db *DB) DeleteTunnel(username, ahash, hash string) error + func (db *DB) DeleteTunnels(username, ahash string) error + func (db *DB) DeleteUser(name string) error + func (db *DB) IsEmpty() (bool, error) + func (db *DB) QueryAgent(username, hash string) (Agent, error) + func (db *DB) QueryAgentCount(username string) (n int, err error) + func (db *DB) QueryAgentHashs(username string) ([]string, error) + func (db *DB) QueryAgents(username string) ([]Agent, error) + func (db *DB) QueryTunnel(username, ahash, hash string) (Tunnel, error) + func (db *DB) QueryTunnelCount(username, ahash string) (n int, err error) + func (db *DB) QueryTunnels(username, ahash string) ([]Tunnel, error) + func (db *DB) QueryUser(name string) (User, error) + func (db *DB) QueryUserCount() (n int, err error) + func (db *DB) QueryUsers() ([]User, error) + func (db *DB) UpdateAgent(username, hash string, args map[string]interface{}) (bool, error) + func (db *DB) UpdateTunnel(username, ahash, hash string, args map[string]interface{}) (bool, error) + func (db *DB) UpdateUser(name string, args map[string]interface{}) (bool, error) + type Tunnel struct + AgentID int + CountAt time.Time + CreatedAt time.Time + Enabled bool + ExportAddr string + Hash string + ID int + NumConn int + Proto string + ServerAddr string + Status string + Tag string + TrafficIn int64 + TrafficOut int64 + UpdatedAt time.Time + func (tunnel Tunnel) MarshalJSON() ([]byte, error) + type TunnelForJSON Tunnel + type User struct + CreatedAt time.Time + Email string + ID int + IsAdmin bool + Name string + Password string + UpdatedAt time.Time + func (user User) MarshalJSON() ([]byte, error) + type UserForJSON User