Documentation ¶
Index ¶
- Constants
- Variables
- func AddAsset(asset *Asset) (bool, error)
- func AddCommand(command *Command) (bool, error)
- func AddRecord(record *Record) (bool, error)
- func AddSession(session *Session) (bool, error)
- func AssetHook(asset *Asset, oldAsset *Asset, action string) error
- func CloseDBSession(id string, code int, msg string) error
- func CloseSession(id string, code int, msg string) error
- func DeleteAsset(asset *Asset) (bool, error)
- func DeleteCommand(command *Command) (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 GetCommandCount(owner, field, value string) (int64, error)
- func GetExecOutput(command *Command) (map[string]string, 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 UpdateAsset(id string, asset *Asset) (bool, error)
- func UpdateCommand(id string, command *Command) (bool, error)
- func UpdateRecord(id string, record *Record) (bool, error)
- func UpdateSession(id string, session *Session, columns ...string) (bool, error)
- func WriteCloseMessage(session *util.GlobalSession, mode string, code int, msg string)
- type Adapter
- type Asset
- func GetAsset(id string) (*Asset, error)
- func GetAssets(owner string) ([]*Asset, error)
- func GetAssetsByName(owner, name string, isAdmin bool) ([]*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 Command
- type File
- type Properties
- type Record
- type RemoteApp
- type Service
- type Session
- func CreateSession(session *Session, assetId, 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)
- type Store
Constants ¶
View Source
const ( NoConnect = "no_connect" Connecting = "connecting" Connected = "connected" Disconnected = "disconnected" )
Variables ¶
View Source
var (
RestartClientChan chan string
)
Functions ¶
func AddCommand ¶ added in v1.32.0
func AddSession ¶
func DeleteAsset ¶
func DeleteCommand ¶ added in v1.32.0
func DeleteRecord ¶
func DeleteSession ¶
func DeleteSessionById ¶
func GetAssetCount ¶
func GetCommandCount ¶ added in v1.32.0
func GetExecOutput ¶ added in v1.32.0
func GetRecordCount ¶
func GetSession ¶
func GetSessionCount ¶
func InitAdapter ¶
func InitAdapter()
func InitConfig ¶
func InitConfig()
func UpdateSession ¶
func WriteCloseMessage ¶
func WriteCloseMessage(session *util.GlobalSession, mode string, code int, msg string)
Types ¶
type Adapter ¶
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"` DisplayName string `xorm:"varchar(100)" json:"displayName"` Category string `xorm:"varchar(20)" json:"category"` Type string `xorm:"varchar(100)" json:"type"` Tag string `xorm:"varchar(200)" json:"tag"` Endpoint string `xorm:"varchar(100)" json:"endpoint"` Port int `json:"port"` Username string `xorm:"varchar(100)" json:"username"` Password string `xorm:"varchar(200)" json:"password"` Os string `xorm:"varchar(100)" json:"os"` Language string `xorm:"varchar(20)" json:"language"` AutoQuery bool `json:"autoQuery"` IsPermanent bool `json:"isPermanent"` EnableRemoteApp bool `json:"enableRemoteApp"` RemoteApps []*RemoteApp `json:"remoteApps"` Services []*Service `json:"services"` GatewayPort int `json:"gatewayPort"` Id string `xorm:"varchar(100)" json:"id"` DatabaseUrl string `xorm:"varchar(200)" json:"databaseUrl"` UseDatabaseUrl bool `json:"useDatabaseUrl"` DatabaseFile string `xorm:"varchar(200)" json:"databaseFile"` SocketPath string `xorm:"varchar(200)" json:"socketPath"` AuthType string `xorm:"varchar(100)" json:"authType"` DefaultDatabase string `xorm:"varchar(100)" json:"defaultDatabase"` IsReadOnly bool `json:"isReadOnly"` }
func GetPaginationAssets ¶
type Command ¶ added in v1.32.0
type Command 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"` DisplayName string `xorm:"varchar(100)" json:"displayName"` Assets []string `json:"assets"` Command string `xorm:"mediumtext" json:"command"` }
func GetCommand ¶ added in v1.32.0
func GetCommands ¶ added in v1.32.0
func GetPaginationCommands ¶ added in v1.32.0
type File ¶ added in v1.35.0
type File struct { Key string `xorm:"varchar(100)" json:"key"` Title string `xorm:"varchar(100)" json:"title"` Size int64 `json:"size"` LastModified string `xorm:"varchar(100)" json:"lastModified"` Mode string `xorm:"varchar(100)" json:"mode"` CreatedTime string `xorm:"varchar(100)" json:"createdTime"` IsLeaf bool `json:"isLeaf"` Url string `xorm:"varchar(255)" json:"url"` Children []*File `xorm:"varchar(1000)" json:"children"` ChildrenMap map[string]*File `xorm:"-" json:"-"` }
type Properties ¶ added in v1.35.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"` Object string `xorm:"-" json:"object"` 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 GetConnSession ¶
func GetPaginationSessions ¶
func GetSessions ¶
func GetSessionsByStatus ¶
type Store ¶ added in v1.35.0
type Store 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"` DisplayName string `xorm:"varchar(100)" json:"displayName"` StorageProvider string `xorm:"varchar(100)" json:"storageProvider"` ImageProvider string `xorm:"varchar(100)" json:"imageProvider"` SplitProvider string `xorm:"varchar(100)" json:"splitProvider"` ModelProvider string `xorm:"varchar(100)" json:"modelProvider"` EmbeddingProvider string `xorm:"varchar(100)" json:"embeddingProvider"` MemoryLimit int `json:"memoryLimit"` Frequency int `json:"frequency"` LimitMinutes int `json:"limitMinutes"` Welcome string `xorm:"varchar(100)" json:"welcome"` Prompt string `xorm:"mediumtext" json:"prompt"` FileTree *File `xorm:"mediumtext" json:"fileTree"` PropertiesMap map[string]*Properties `xorm:"mediumtext" json:"propertiesMap"` }
func (*Store) GetStorageProviderObj ¶ added in v1.35.0
func (store *Store) GetStorageProviderObj() (storage.StorageProvider, error)
Click to show internal directories.
Click to hide internal directories.