Documentation
¶
Index ¶
- Constants
- func AddAsset(asset *Asset) (bool, error)
- func AddMachine(machine *Machine) (bool, error)
- func AddProvider(provider *Provider) (bool, error)
- func AddRecord(record *Record) bool
- func AddSession(session *Session) (bool, error)
- func CloseDBSession(id string, code int, msg string) error
- func CloseSession(id string, code int, msg string) error
- func CommitRecord(record *Record) (bool, error)
- func DeleteAsset(asset *Asset) (bool, error)
- func DeleteMachine(machine *Machine) (bool, error)
- func DeleteProvider(provider *Provider) (bool, error)
- func DeleteRecord(record *Record) (bool, error)
- func DeleteSession(session *Session) (bool, error)
- func DeleteSessionById(id string) (bool, error)
- func GetAssetCount(owner, field, value string) (int64, error)
- func GetMachineCount(owner, field, value string) (int64, error)
- func GetProviderCount(owner, field, value string) (int64, error)
- func GetRecordCount(owner, field, value string) (int64, error)
- func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session
- func GetSessionCount(owner, status, field, value string) (int64, error)
- func InitAdapter()
- func InitConfig()
- func QueryRecord(id string) (string, error)
- func SyncMachinesCloud(owner string) (bool, error)
- func UpdateAsset(id string, asset *Asset) (bool, error)
- func UpdateMachine(id string, machine *Machine) (bool, error)
- func UpdateProvider(id string, provider *Provider) (bool, error)
- func UpdateRecord(id string, record *Record) (bool, error)
- func UpdateSession(id string, session *Session, columns ...string) (bool, error)
- func WriteCloseMessage(session *guacamole.Session, mode string, code int, msg string)
- type Adapter
- type Asset
- func GetAsset(id string) (*Asset, error)
- func GetAssets(owner string) ([]*Asset, error)
- func GetMaskedAsset(asset *Asset, errs ...error) (*Asset, error)
- func GetMaskedAssets(assets []*Asset, errs ...error) ([]*Asset, error)
- func GetPaginationAssets(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Asset, error)
- type Machine
- func GetMachine(id string) (*Machine, error)
- func GetMachines(owner string) ([]*Machine, error)
- func GetMaskedMachine(machine *Machine, errs ...error) (*Machine, error)
- func GetMaskedMachines(machines []*Machine, errs ...error) ([]*Machine, error)
- func GetPaginationMachines(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Machine, error)
- type Patch
- type Provider
- func GetMaskedProvider(provider *Provider, errs ...error) (*Provider, error)
- func GetMaskedProviders(providers []*Provider, errs ...error) ([]*Provider, error)
- func GetPaginationProviders(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Provider, error)
- func GetProvider(id string) (*Provider, error)
- func GetProviders(owner string) ([]*Provider, error)
- type Record
- type RemoteApp
- type Response
- type Service
- type Session
- func CreateSession(session *Session, machineId string, mode string) (*Session, error)
- func GetConnSession(id string) (*Session, error)
- func GetPaginationSessions(owner, status string, offset, limit int, ...) ([]*Session, error)
- func GetSessions(owner string) ([]*Session, error)
- func GetSessionsByStatus(statuses []string) ([]*Session, error)
Constants ¶
View Source
const ( NoConnect = "no_connect" Connecting = "connecting" Connected = "connected" Disconnected = "disconnected" )
Variables ¶
This section is empty.
Functions ¶
func AddMachine ¶ added in v1.101.0
func AddProvider ¶ added in v1.101.0
func AddSession ¶
func CommitRecord ¶ added in v1.101.0
func DeleteAsset ¶
func DeleteMachine ¶ added in v1.101.0
func DeleteProvider ¶ added in v1.101.0
func DeleteRecord ¶
func DeleteSession ¶
func DeleteSessionById ¶
func GetAssetCount ¶
func GetMachineCount ¶ added in v1.101.0
func GetProviderCount ¶ added in v1.101.0
func GetRecordCount ¶
func GetSession ¶
func GetSessionCount ¶
func InitAdapter ¶
func InitAdapter()
func InitConfig ¶
func InitConfig()
func QueryRecord ¶ added in v1.101.0
func SyncMachinesCloud ¶ added in v1.101.0
func UpdateMachine ¶ added in v1.101.0
func UpdateProvider ¶ added in v1.101.0
func UpdateSession ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter represents the MySQL adapter for policy storage.
func NewAdapter ¶
NewAdapter is the constructor for Adapter.
type Asset ¶
type Asset struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
Tag string `xorm:"varchar(100)" json:"tag"`
MachineName string `xorm:"varchar(100)" json:"machineName"`
Os string `xorm:"varchar(100)" json:"os"`
PublicIp string `xorm:"varchar(100)" json:"publicIp"`
PrivateIp string `xorm:"varchar(100)" json:"privateIp"`
Size string `xorm:"varchar(100)" json:"size"`
CpuSize string `xorm:"varchar(100)" json:"cpuSize"`
MemSize string `xorm:"varchar(100)" json:"memSize"`
RemoteProtocol string `xorm:"varchar(100)" json:"remoteProtocol"`
RemotePort int `json:"remotePort"`
RemoteUsername string `xorm:"varchar(100)" json:"remoteUsername"`
RemotePassword string `xorm:"varchar(100)" json:"remotePassword"`
AutoQuery bool `json:"autoQuery"`
IsPermanent bool `json:"isPermanent"`
Language string `xorm:"varchar(100)" json:"language"`
EnableRemoteApp bool `json:"enableRemoteApp"`
RemoteApps []*RemoteApp `json:"remoteApps"`
Services []*Service `json:"services"`
Patches []*Patch `json:"patches"`
}
type Machine ¶ added in v1.101.0
type Machine struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
Id string `xorm:"varchar(100)" json:"id"`
Provider string `xorm:"varchar(100)" json:"provider"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
ExpireTime string `xorm:"varchar(100)" json:"expireTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Region string `xorm:"varchar(100)" json:"region"`
Zone string `xorm:"varchar(100)" json:"zone"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
Size string `xorm:"varchar(100)" json:"size"`
Tag string `xorm:"varchar(100)" json:"tag"`
State string `xorm:"varchar(100)" json:"state"`
Image string `xorm:"varchar(100)" json:"image"`
Os string `xorm:"varchar(100)" json:"os"`
PublicIp string `xorm:"varchar(100)" json:"publicIp"`
PrivateIp string `xorm:"varchar(100)" json:"privateIp"`
CpuSize string `xorm:"varchar(100)" json:"cpuSize"`
MemSize string `xorm:"varchar(100)" json:"memSize"`
// DB info
RemoteProtocol string `xorm:"varchar(100)" json:"remoteProtocol"`
RemotePort int `json:"remotePort"`
RemoteUsername string `xorm:"varchar(100)" json:"remoteUsername"`
RemotePassword string `xorm:"varchar(100)" json:"remotePassword"`
}
func GetMachine ¶ added in v1.101.0
func GetMachines ¶ added in v1.101.0
func GetMaskedMachine ¶ added in v1.101.0
func GetMaskedMachines ¶ added in v1.101.0
func GetPaginationMachines ¶ added in v1.101.0
type Patch ¶ added in v1.62.0
type Patch struct {
Name string `json:"name"`
Category string `json:"category"`
Title string `json:"title"`
Url string `json:"url"`
Size string `json:"size"`
ExpectedStatus string `json:"expectedStatus"`
Status string `json:"status"`
InstallTime string `json:"installTime"`
Message string `json:"message"`
}
type Provider ¶ added in v1.101.0
type Provider struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
ClientId string `xorm:"varchar(100)" json:"clientId"`
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
Region string `xorm:"varchar(100)" json:"region"`
Network string `xorm:"varchar(100)" json:"network"`
Chain string `xorm:"varchar(100)" json:"chain"`
BrowserUrl string `xorm:"varchar(200)" json:"browserUrl"`
State string `xorm:"varchar(100)" json:"state"`
ProviderUrl string `xorm:"varchar(200)" json:"providerUrl"`
}
func GetMaskedProvider ¶ added in v1.101.0
func GetMaskedProviders ¶ added in v1.101.0
func GetPaginationProviders ¶ added in v1.101.0
func GetProvider ¶ added in v1.101.0
func GetProviders ¶ added in v1.101.0
type Record ¶
type Record struct {
Id int `xorm:"int notnull pk autoincr" json:"id"`
Owner string `xorm:"varchar(100) index" json:"owner"`
Name string `xorm:"varchar(100) index" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Organization string `xorm:"varchar(100)" json:"organization"`
ClientIp string `xorm:"varchar(100)" json:"clientIp"`
User string `xorm:"varchar(100)" json:"user"`
Method string `xorm:"varchar(100)" json:"method"`
RequestUri string `xorm:"varchar(1000)" json:"requestUri"`
Action string `xorm:"varchar(1000)" json:"action"`
Language string `xorm:"varchar(100)" json:"language"`
Object string `xorm:"mediumtext" json:"object"`
Response string `xorm:"mediumtext" json:"response"`
Provider string `xorm:"varchar(100)" json:"provider"`
Block string `xorm:"varchar(100)" json:"block"`
IsTriggered bool `json:"isTriggered"`
}
func GetPaginationRecords ¶
func GetRecords ¶
type Session ¶
type Session struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
StartTime string `xorm:"varchar(100)" json:"startTime"`
EndTime string `xorm:"varchar(100)" json:"endTime"`
Protocol string `xorm:"varchar(20)" json:"protocol"`
ConnectionId string `xorm:"varchar(50)" json:"connectionId"`
Asset string `xorm:"varchar(200) index" json:"asset"`
Creator string `xorm:"varchar(36) index" json:"creator"`
ClientIp string `xorm:"varchar(200)" json:"clientIp"`
UserAgent string `xorm:"varchar(200)" json:"userAgent"`
ClientIpDesc string `xorm:"varchar(100)" json:"clientIpDesc"`
UserAgentDesc string `xorm:"varchar(100)" json:"userAgentDesc"`
Width int `json:"width"`
Height int `json:"height"`
Status string `xorm:"varchar(20) index" json:"status"`
Recording string `xorm:"varchar(1000)" json:"recording"`
Code int `json:"code"`
Message string `json:"message"`
Mode string `xorm:"varchar(10)" json:"mode"`
Operations []string `xorm:"json varchar(1000)" json:"operations"`
Reviewed bool `json:"reviewed"`
CommandCount int64 `json:"commandCount"`
}
func CreateSession ¶
func GetConnSession ¶
func GetPaginationSessions ¶
func GetSessions ¶
func GetSessionsByStatus ¶
Click to show internal directories.
Click to hide internal directories.