Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminHostBan ¶
type AdminSession ¶
type AdminSession struct { Id int64 `json:"id"` Host string `json:"host"` Port int `json:"port"` SessionId string `json:"sessionid"` Protocol string `json:"protocol"` Title string `json:"title"` Users int `json:"users"` MaxUsers int `json:"maxusers,omitempty"` Usernames []string `json:"usernames"` Password bool `json:"password"` Nsfm bool `json:"nsfm"` Owner string `json:"owner"` Started string `json:"started"` LastActive string `json:"lastactive"` Unlisted bool `json:"unlisted"` UpdateKey string `json:"updatekey"` ClientIp string `json:"clientip"` Alias string `json:"alias,omitempty"` UnlistReason string `json:"unlistreason,omitempty"` Kicked bool `json:"kicked"` TimedOut bool `json:"timedout"` Closed bool `json:"closed"` Included bool `json:"included"` Error string `json:"error,omitempty"` ActiveDrawingUsers int `json:"activedrawingusers"` AllowWeb bool `json:"allowweb,omitempty"` }
type AdminUserDetail ¶
type Database ¶
type Database interface { SessionTimeoutMinutes() int QuerySessionList(opts QueryOptions, ctx context.Context) ([]SessionInfo, error) IsActiveSession(host, id string, port int, ctx context.Context) (bool, error) GetHostSessionCount(host string, ctx context.Context) (int, error) IsBannedHost(host string, ctx context.Context) (bool, error) InsertSession(session SessionInfo, clientIp string, ctx context.Context) (NewSessionInfo, error) RefreshSession(refreshFields map[string]interface{}, listingId int64, updateKey string, ctx context.Context) error DeleteSession(listingId int64, updateKey string, ctx context.Context) (bool, error) AdminUpdateSessions(ids []int64, unlisted bool, unlistReason string, ctx context.Context) ([]int64, error) AdminQuerySessions(ctx context.Context) ([]AdminSession, error) AdminCreateHostBan(host string, expires string, notes string, ctx context.Context) (int64, error) AdminUpdateHostBan(id int64, host string, expires string, notes string, ctx context.Context) (bool, error) AdminDeleteHostBan(id int64, ctx context.Context) (bool, error) AdminQueryHostBans(ctx context.Context) ([]AdminHostBan, error) AdminCreateRole(name string, admin bool, accessSessions int64, accessHostbans int64, accessRoles int64, accessUsers int64, ctx context.Context) (int64, error) AdminUpdateRole(id int64, name string, admin bool, accessSessions int64, accessHostbans int64, accessRoles int64, accessUsers int64, ctx context.Context) (bool, error) AdminDeleteRole(id int64, ctx context.Context) (bool, error) AdminQueryRoles(ctx context.Context) ([]AdminRole, error) AdminQueryRoleByName(name string, ctx context.Context) (AdminRole, error) AdminCreateUser(name string, passwordHash string, role int64, ctx context.Context) (int64, error) AdminUpdateUser(id int64, name string, paswordHash string, role int64, ctx context.Context) (bool, error) AdminUpdateUserPassword(id int64, passwordHash string, ctx context.Context) (bool, error) AdminDeleteUser(id int64, ctx context.Context) (bool, error) AdminQueryUserByName(name string, ctx context.Context) (AdminUserDetail, error) AdminQueryUsers(ctx context.Context) ([]AdminUser, error) Close() error }
func InitDatabase ¶
type JoinSessionInfo ¶
type JoinSessionInfo struct { Host string `json:"host"` Port int `json:"port"` Id string `json:"id"` }
Minimum info needed to join a session
type NewSessionInfo ¶
Info about a newly inserted session
type QueryOptions ¶
type QueryOptions struct { Title string // filter by title Nsfm bool // show NSFM sessions Protocol string // filter by protocol version (comma separated list accepted) }
Session list querying options
type RefreshError ¶
type RefreshError struct {
// contains filtered or unexported fields
}
func (RefreshError) Error ¶
func (e RefreshError) Error() string
type SessionInfo ¶
type SessionInfo struct { Host string `json:"host"` Port int `json:"port"` Id string `json:"id"` Protocol string `json:"protocol"` Title string `json:"title"` Users int `json:"users"` MaxUsers int `json:"maxusers,omitempty"` Usernames []string `json:"usernames"` Password bool `json:"password"` Nsfm bool `json:"nsfm"` Owner string `json:"owner"` Started string `json:"started"` Private bool `json:"private,omitempty"` Closed bool `json:"closed,omitempty"` ActiveDrawingUsers int `json:"activedrawingusers"` AllowWeb bool `json:"allowweb,omitempty"` }
The SessionInfo struct represents a session announcement fetched from the database It is also used to insert new entries. When inserting, the "Started" field is ignored and the current timestamp is used
func (SessionInfo) HostAddress ¶
func (info SessionInfo) HostAddress() string
func (*SessionInfo) UnmarshalJSON ¶
func (info *SessionInfo) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.