Documentation ¶
Index ¶
- Constants
- Variables
- func Close(closer io.Closer)
- func CloseResponse(response *http.Response)
- func ContainsScope(arr []*Scope, value *Scope) bool
- func Convert(val interface{}, target interface{}) (interface{}, error)
- func CopyFile(src, dest string) error
- func DownloadFile(url, fileName string, env Environment) error
- func DownloadFileToCache(url, fileName string) error
- func DownloadViaMaven(downloadUrl string, env Environment) (string, error)
- func EnsureAccess(source string, prefix string) bool
- func ExtractFileFromZip(name, directory, targetFile string) error
- func ExtractTar(stream io.Reader, directory string) error
- func ExtractTarGz(gzipStream io.Reader, directory string) error
- func ExtractZip(name, directory string) error
- func ExtractZipIgnoreSingleDir(name, directory string) error
- func GenerateRandomString(n int) (string, error)
- func GenerateValidationMessage(err error) error
- func GetBooleanOrDefault(data map[string]interface{}, key string, def bool) bool
- func GetMapOrNull(data map[string]interface{}, key string) map[string]interface{}
- func GetObjectArrayOrNull(data map[string]interface{}, key string) []interface{}
- func GetStringArrayOrNull(data map[string]interface{}, key string) []string
- func GetStringOrDefault(data map[string]interface{}, key string, def string) string
- func Http() *http.Client
- func HttpGet(url string) (*http.Response, error)
- func HttpGetTarGz(url, directory string) error
- func HttpGetZip(url, directory string) error
- func JoinPath(paths ...string) string
- func Recover()
- func RemoveInvalidSymlinks(files []os.DirEntry, sourceFolder, prefix string) []os.DirEntry
- func ReplaceTokens(msg string, mapping map[string]interface{}) string
- func ReplaceTokensInArr(msg []string, mapping map[string]interface{}) []string
- func ReplaceTokensInMap(msg map[string]string, mapping map[string]interface{}) map[string]string
- func SplitArguments(source string) (cmd string, arguments []string)
- func ToString(v interface{}) string
- func Union[T comparable](a, b []T) []T
- func UnmarshalTo(source, target interface{}) error
- func UserInGroup(groups ...string) bool
- type BaseEnvironment
- func (e *BaseEnvironment) AddConsoleListener(ws *Socket)
- func (e *BaseEnvironment) AddStatsListener(ws *Socket)
- func (e *BaseEnvironment) AddStatusListener(ws *Socket)
- func (e *BaseEnvironment) Create() error
- func (e *BaseEnvironment) CreateConsoleStdinProxy(config StdinConsoleConfiguration, base io.WriteCloser)
- func (e *BaseEnvironment) CreateWrapper() io.Writer
- func (e *BaseEnvironment) Delete() (err error)
- func (e *BaseEnvironment) DisplayToConsole(daemon bool, msg string, data ...interface{})
- func (e *BaseEnvironment) Execute(steps ExecutionData) error
- func (e *BaseEnvironment) ExecuteAsync(steps ExecutionData) (err error)
- func (e *BaseEnvironment) ExecuteInMainProcess(cmd string) (err error)
- func (e *BaseEnvironment) GetBase() *BaseEnvironment
- func (e *BaseEnvironment) GetConsole() (console []byte, epoch int64)
- func (e *BaseEnvironment) GetConsoleFrom(time int64) (console []byte, epoch int64)
- func (e *BaseEnvironment) GetLastExitCode() int
- func (e *BaseEnvironment) GetRootDirectory() string
- func (e *BaseEnvironment) GetStatsTracker() *Tracker
- func (e *BaseEnvironment) GetWrapper() io.Writer
- func (e *BaseEnvironment) IsInstalling() bool
- func (e *BaseEnvironment) IsRunning() (isRunning bool, err error)
- func (e *BaseEnvironment) Kill() error
- func (e *BaseEnvironment) Log(l *log.Logger, format string, obj ...interface{})
- func (e *BaseEnvironment) SetInstalling(flag bool)
- func (e *BaseEnvironment) Update() error
- func (e *BaseEnvironment) WaitForMainProcess() error
- func (e *BaseEnvironment) WaitForMainProcessFor(timeout time.Duration) (err error)
- type Command
- type ConditionalMetadataType
- type Console
- type CreateOperation
- type DaemonRunning
- type Environment
- type EnvironmentFactory
- type Error
- type ErrorResponse
- type Execution
- type ExecutionData
- type ExecutionFunction
- type Filesystem
- type Group
- type MemoryCache
- type MergedFS
- type Message
- type Metadata
- type MetadataType
- type Name
- type NoStartConsole
- type Operation
- type OperationFactory
- type OperationResult
- type Paging
- type RCONConnection
- type RCONWSConnection
- type Requirements
- type SFTPAuthorization
- type Scope
- type Server
- type ServerData
- type ServerDataAdmin
- type ServerFlags
- type ServerIdResponse
- type ServerLogs
- type ServerRunning
- type ServerStats
- type ServerTask
- type ServerTasks
- type Socket
- type StdinConsoleConfiguration
- type Task
- type TelnetConnection
- type Tracker
- type Type
- type Variable
- type VariableOption
Constants ¶
View Source
const MaxRecursivePath = 256
Variables ¶
View Source
var ( ScopeAdmin = registerNonServerScope("admin") ScopeLogin = registerNonServerScope("login") //can you log in ScopeOAuth2Auth = registerNonServerScope("oauth2.auth") //can you validate user credentials over OAuth2 ScopeNodesView = registerNonServerScope("nodes.view") //can you globally view nodes ScopeNodesCreate = registerNonServerScope("nodes.create") //can you create nodes ScopeNodesEdit = registerNonServerScope("nodes.edit") //can you edit an existing node ScopeNodesDelete = registerNonServerScope("nodes.delete") //can you delete a node ScopeNodesDeploy = registerNonServerScope("nodes.deploy") //can you deploy the node (this has secret info, which is why it's special) ScopeSelfEdit = registerNonServerScope("self.edit") //can you manage your own account ScopeSelfClients = registerNonServerScope("self.clients") //can the user create and manage OAuth2 clients for their own account ScopeServerCreate = registerNonServerScope("server.create") ScopeServerView = registerServerScope("server.view") ScopeServerAdmin = registerServerScope("server.admin") ScopeServerDelete = registerServerScope("server.delete") ScopeServerEditDefinition = registerServerScope("server.definition.edit") ScopeServerEditData = registerServerScope("server.data.edit") ScopeServerEditFlags = registerServerScope("server.flags.edit") ScopeServerEditName = registerServerScope("server.name.edit") ScopeServerViewDefinition = registerServerScope("server.definition.view") ScopeServerViewData = registerServerScope("server.data.view") ScopeServerViewFlags = registerServerScope("server.flags.view") ScopeServerClientView = registerServerScope("server.clients.view") ScopeServerClientEdit = registerServerScope("server.clients.edit") ScopeServerClientCreate = registerServerScope("server.clients.create") ScopeServerClientDelete = registerServerScope("server.clients.delete") ScopeServerUserView = registerServerScope("server.users.view") ScopeServerUserCreate = registerServerScope("server.users.create") ScopeServerUserEdit = registerServerScope("server.users.edit") ScopeServerUserDelete = registerServerScope("server.users.delete") ScopeServerTaskView = registerServerScope("server.tasks.view") ScopeServerTaskRun = registerServerScope("server.tasks.run") ScopeServerTaskCreate = registerServerScope("server.tasks.create") ScopeServerTaskDelete = registerServerScope("server.tasks.delete") ScopeServerTaskEdit = registerServerScope("server.tasks.edit") ScopeServerReload = registerServerScope("server.reload") ScopeServerStart = registerServerScope("server.start") ScopeServerStop = registerServerScope("server.stop") ScopeServerKill = registerServerScope("server.kill") ScopeServerInstall = registerServerScope("server.install") ScopeServerFileView = registerServerScope("server.files.view") ScopeServerFileEdit = registerServerScope("server.files.edit") ScopeServerSftp = registerServerScope("server.sftp") ScopeServerConsole = registerServerScope("server.console") ScopeServerSendCommand = registerServerScope("server.console.send") ScopeServerStats = registerServerScope("server.stats") ScopeServerStatus = registerServerScope("server.status") ScopeSettingsEdit = registerNonServerScope("settings.edit") ScopeTemplatesView = registerNonServerScope("templates.view") ScopeTemplatesLocalEdit = registerNonServerScope("templates.local.edit") ScopeTemplatesRepoCreate = registerNonServerScope("templates.repo.create") ScopeTemplatesRepoDelete = registerNonServerScope("templates.repo.delete") ScopeUserInfoSearch = registerNonServerScope("users.info.search") ScopeUserInfoView = registerNonServerScope("users.info.view") ScopeUserInfoEdit = registerNonServerScope("users.info.edit") ScopeUserPermsView = registerNonServerScope("users.perms.view") ScopeUserPermsEdit = registerNonServerScope("users.perms.edit") ScopePanel = registerNonServerScope("panel") )
View Source
var ( Hash = "unknown" Version = "nightly" Display string )
View Source
var Engine *gin.Engine
View Source
var ErrCannotValidateToken = CreateError("could not validate access token", "ErrCannotValidateToken")
View Source
var ErrClientNotFound = CreateError("client not found", "ErrClientNotFound")
View Source
var ErrContainerRunning = CreateError("container already running", "ErrContainerRunning")
View Source
var ErrDatabaseNotAvailable = CreateError("database not available", "ErrDatabaseNotAvailable")
View Source
var ErrDockerNotSupported = CreateError("docker not supported", "ErrDockerNotSupported")
View Source
var ErrEmailNotConfigured = CreateError("email not configured", "ErrEmailNotConfigured")
View Source
var ErrEnvironmentNotSupported = CreateError("environment not supported", "ErrEnvironmentNotSupported")
View Source
var ErrFactoryError = func(operatorName string, err error) *Error { return CreateError("factory `${operatorName}` encountered an error: `${err}`", "ErrFactoryError").Metadata(map[string]interface{}{"operatorName": operatorName, "err": err.Error()}) }
View Source
var ErrFieldEqual = func(fieldName1, fieldName2 string) *Error { return CreateError("${field1} cannot be equal to ${field2}", "ErrFieldEqual").Metadata(map[string]interface{}{"field1": fieldName1, "field2": fieldName2}) }
View Source
var ErrFieldHasURICharacters = func(fieldName string) *Error { return CreateError("${field} must not contain characters which cannot be used in URIs", "ErrFieldHasURICharacters").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldIsInvalidHost = func(fieldName string) *Error { return CreateError("${field} must be a valid IP or FQDN", "ErrFieldIsInvalidHost").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldIsInvalidIP = func(fieldName string) *Error { return CreateError("${field} must be a valid IP", "ErrFieldIsInvalidIP").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldLength = func(fieldName string, min int, max int) *Error { return CreateError("${field} must be between ${min} and ${max} characters", "ErrFieldLength").Metadata(map[string]interface{}{"field": fieldName, "min": min, "max": max}) }
View Source
var ErrFieldMustBePrintable = func(fieldName string) *Error { return CreateError("${field} must be printable ascii characters", "ErrFieldMustBePrintable").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldNotBetween = func(fieldName string, min, max int64) *Error { return CreateError("${field} must be between ${min} and ${max}", "ErrFieldNotBetween").Metadata(map[string]interface{}{"field": fieldName, "min": min, "max": max}) }
View Source
var ErrFieldNotEmail = func(fieldName string) *Error { return CreateError("${field} is not a valid email", "ErrFieldNotEmail").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldNotEqual = func(fieldName1, fieldName2 string) *Error { return CreateError("${field1} is not equal to ${field2}", "ErrFieldNotEqual").Metadata(map[string]interface{}{"field1": fieldName1, "field2": fieldName2}) }
View Source
var ErrFieldRequired = func(fieldName string) *Error { return CreateError("${field} is required", "ErrFieldRequired").Metadata(map[string]interface{}{"field": fieldName}) }
View Source
var ErrFieldTooLarge = func(fieldName string, value int64) *Error { return CreateError("${field} cannot be larger than ${max}", "ErrFieldTooLarge").Metadata(map[string]interface{}{"field": fieldName, "max": value}) }
View Source
var ErrFieldTooSmall = func(fieldName string, value int64) *Error { return CreateError("${field} cannot be smaller than ${min}", "ErrFieldTooSmall").Metadata(map[string]interface{}{"field": fieldName, "min": value}) }
View Source
var ErrFileExists = CreateError("file exists where there should be none", "ErrFileExists")
View Source
var ErrFileNotFound = CreateError("file not found", "ErrFileNotFound")
View Source
var ErrIllegalFileAccess = CreateError("invalid file access", "ErrIllegalFileAccess")
View Source
var ErrImageDownloading = CreateError("image downloading", "ErrImageDownloading")
View Source
var ErrInvalidCredentials = CreateError("invalid credentials", "ErrInvalidCredentials")
View Source
var ErrInvalidSession = CreateError("invalid session", "ErrInvalidSession")
View Source
var ErrInvalidTokenState = CreateError("invalid token state", "ErrInvalidTokenState")
View Source
var ErrInvalidUnixTime = CreateError("time provided is not a valid UNIX time", "ErrInvalidUnixTime")
View Source
var ErrKeyNotECDSA = CreateError("key is not ECDSA key", "ErrKeyNotECDSA")
View Source
var ErrKeyNotPEM = CreateError("key is not in PEM format", "ErrKeyNotPEM")
View Source
var ErrLoginNotPermitted = CreateError("login not permitted", "ErrLoginNotPermitted")
View Source
var ErrMissingAccessToken = CreateError("access token not provided", "ErrMissingAccessToken")
View Source
var ErrMissingBinary = func(expected string) *Error { return CreateError("missing binary: ${expected}", "ErrMissingBinary").Metadata(map[string]interface{}{"expected": expected}) }
View Source
var ErrMissingFactory = CreateError("missing factory", "ErrMissingFactory")
View Source
var ErrMissingScope = CreateError("missing scope", "ErrMissingScope")
View Source
var ErrNoCommand = CreateError("command could not be determined", "ErrNoCommand")
View Source
var ErrNoPermission = CreateError("no permission to perform action", "ErrNoPermission")
View Source
var ErrNoTemplate = func(template string) *Error { return CreateError("no template with name ${name}", "ErrNoTemplate").Metadata(map[string]interface{}{"template": template}) }
View Source
var ErrNodeHasServers = CreateError("node has servers associated", "ErrNodeHasServers")
View Source
var ErrNodeInvalid = CreateError("node is invalid", "ErrNodeInvalid")
View Source
var ErrNotBearerToken = CreateError("access token must be a Bearer token", "ErrNotBearerToken")
View Source
var ErrNotImplemented = CreateError("not implemented", "ErrNotImplemented")
View Source
var ErrPathNotAbs = func(path string) *Error { return CreateError("path not abs: ${path}", "ErrPathNotAbs").Metadata(map[string]interface{}{"path": path}) }
View Source
var ErrProcessRunning = CreateError("process already running", "ErrProcessRunning")
View Source
var ErrRepoExists = CreateError("repo already exists with given name", "ErrRepoExists")
View Source
var ErrServerAlreadyExists = CreateError("server already exists", "ErrServerAlreadyExists")
View Source
var ErrServerDisabled = CreateError("server is disabled", "ErrServerDisabled")
View Source
var ErrServerNotFound = CreateError("server not found", "ErrServerNotFound")
View Source
var ErrServerOffline = CreateError("server offline", "ErrServerOffline")
View Source
var ErrServerRunning = CreateError("server running", "ErrServerRunning")
View Source
var ErrServiceInvalidProvider = func(service, provider string) *Error { return CreateError("{service} does not support ${provider}", "ErrServiceInvalidProvider").Metadata(map[string]interface{}{"service": service, "provider": provider}) }
View Source
var ErrServiceNotAvailable = CreateError("service not available", "ErrServiceNotAvailable")
View Source
var ErrSessionExpired = CreateError("session expired", "ErrSessionExpired")
View Source
var ErrSettingNotConfigured = func(name string) *Error { return CreateError("${setting} is not configured", "ErrSettingNotConfigured").Metadata(map[string]interface{}{"setting": name}) }
View Source
var ErrTaskNotFound = CreateError("task not found", "ErrTaskNotFound")
View Source
var ErrTokenInvalid = CreateError("token is invalid", "ErrTokenInvalid")
View Source
var ErrUnknownError = CreateError("unknown error", "ErrUnknownError")
View Source
var ErrUnsupportedArch = func(actual, expected string) *Error { return CreateError("Architecture ${actual} not supported. Supported Architectures: ${expected}", "ErrUnsupportedArch").Metadata(map[string]interface{}{"actual": actual, "expected": expected}) }
View Source
var ErrUnsupportedOS = func(actual, expected string) *Error { return CreateError("OS (${actual}) not supported. Supported OS: ${expected}", "ErrUnsupportedOS").Metadata(map[string]interface{}{"actual": actual, "expected": expected}) }
View Source
var ErrUserNotFound = CreateError("user not found", "ErrUserNotFound")
Functions ¶
func CloseResponse ¶
func ContainsScope ¶
func Convert ¶
func Convert(val interface{}, target interface{}) (interface{}, error)
Convert Converts the val parameter to the same type as the target
func DownloadFile ¶
func DownloadFile(url, fileName string, env Environment) error
func DownloadFileToCache ¶
func DownloadViaMaven ¶
func DownloadViaMaven(downloadUrl string, env Environment) (string, error)
func EnsureAccess ¶
func ExtractFileFromZip ¶
func ExtractZip ¶
func GenerateRandomString ¶
func GetBooleanOrDefault ¶
func GetMapOrNull ¶
func GetObjectArrayOrNull ¶
func GetStringArrayOrNull ¶
func GetStringOrDefault ¶
func HttpGetTarGz ¶
func HttpGetZip ¶
func RemoveInvalidSymlinks ¶
func ReplaceTokens ¶
func ReplaceTokensInArr ¶
func ReplaceTokensInMap ¶
func SplitArguments ¶
func Union ¶
func Union[T comparable](a, b []T) []T
func UnmarshalTo ¶
func UnmarshalTo(source, target interface{}) error
func UserInGroup ¶
Types ¶
type BaseEnvironment ¶
type BaseEnvironment struct { Environment Type string `json:"type"` RootDirectory string `json:"root,omitempty"` ConsoleBuffer *MemoryCache `json:"-"` Wait *sync.WaitGroup `json:"-"` ExecutionFunction ExecutionFunction `json:"-"` ServerId string `json:"-"` LastExitCode int `json:"-"` Wrapper io.Writer `json:"-"` //our proxy back to the main ConsoleTracker *Tracker `json:"-"` StatusTracker *Tracker `json:"-"` StatsTracker *Tracker `json:"-"` Installing bool `json:"-"` IsRunningFunc func() (bool, error) `json:"-"` KillFunc func() error `json:"-"` Console Console `json:"-"` }
func (*BaseEnvironment) AddConsoleListener ¶
func (e *BaseEnvironment) AddConsoleListener(ws *Socket)
func (*BaseEnvironment) AddStatsListener ¶
func (e *BaseEnvironment) AddStatsListener(ws *Socket)
func (*BaseEnvironment) AddStatusListener ¶
func (e *BaseEnvironment) AddStatusListener(ws *Socket)
func (*BaseEnvironment) Create ¶
func (e *BaseEnvironment) Create() error
func (*BaseEnvironment) CreateConsoleStdinProxy ¶
func (e *BaseEnvironment) CreateConsoleStdinProxy(config StdinConsoleConfiguration, base io.WriteCloser)
func (*BaseEnvironment) CreateWrapper ¶
func (e *BaseEnvironment) CreateWrapper() io.Writer
func (*BaseEnvironment) Delete ¶
func (e *BaseEnvironment) Delete() (err error)
func (*BaseEnvironment) DisplayToConsole ¶
func (e *BaseEnvironment) DisplayToConsole(daemon bool, msg string, data ...interface{})
func (*BaseEnvironment) Execute ¶
func (e *BaseEnvironment) Execute(steps ExecutionData) error
func (*BaseEnvironment) ExecuteAsync ¶
func (e *BaseEnvironment) ExecuteAsync(steps ExecutionData) (err error)
func (*BaseEnvironment) ExecuteInMainProcess ¶
func (e *BaseEnvironment) ExecuteInMainProcess(cmd string) (err error)
func (*BaseEnvironment) GetBase ¶
func (e *BaseEnvironment) GetBase() *BaseEnvironment
func (*BaseEnvironment) GetConsole ¶
func (e *BaseEnvironment) GetConsole() (console []byte, epoch int64)
func (*BaseEnvironment) GetConsoleFrom ¶
func (e *BaseEnvironment) GetConsoleFrom(time int64) (console []byte, epoch int64)
func (*BaseEnvironment) GetLastExitCode ¶
func (e *BaseEnvironment) GetLastExitCode() int
func (*BaseEnvironment) GetRootDirectory ¶
func (e *BaseEnvironment) GetRootDirectory() string
func (*BaseEnvironment) GetStatsTracker ¶
func (e *BaseEnvironment) GetStatsTracker() *Tracker
func (*BaseEnvironment) GetWrapper ¶
func (e *BaseEnvironment) GetWrapper() io.Writer
func (*BaseEnvironment) IsInstalling ¶
func (e *BaseEnvironment) IsInstalling() bool
func (*BaseEnvironment) IsRunning ¶
func (e *BaseEnvironment) IsRunning() (isRunning bool, err error)
func (*BaseEnvironment) Kill ¶
func (e *BaseEnvironment) Kill() error
func (*BaseEnvironment) Log ¶
func (e *BaseEnvironment) Log(l *log.Logger, format string, obj ...interface{})
func (*BaseEnvironment) SetInstalling ¶
func (e *BaseEnvironment) SetInstalling(flag bool)
func (*BaseEnvironment) Update ¶
func (e *BaseEnvironment) Update() error
func (*BaseEnvironment) WaitForMainProcess ¶
func (e *BaseEnvironment) WaitForMainProcess() error
func (*BaseEnvironment) WaitForMainProcessFor ¶
func (e *BaseEnvironment) WaitForMainProcessFor(timeout time.Duration) (err error)
type Command ¶
type Command struct { If string `json:"if,omitempty"` Command string `json:"command"` StdIn StdinConsoleConfiguration `json:"stdin"` } //@name Command
type ConditionalMetadataType ¶
type ConditionalMetadataType struct { If string `json:"if,omitempty"` MetadataType } //@name MetadataWithIf
func (*ConditionalMetadataType) MarshalJSON ¶
func (t *ConditionalMetadataType) MarshalJSON() ([]byte, error)
func (*ConditionalMetadataType) ParseMetadata ¶
func (t *ConditionalMetadataType) ParseMetadata(target interface{}) error
ParseMetadata Parses the metadata into the target interface
func (*ConditionalMetadataType) UnmarshalJSON ¶
func (t *ConditionalMetadataType) UnmarshalJSON(bs []byte) error
UnmarshalJSON parses a type with this declaration, storing what it needs into metadata and type
type Console ¶
type Console interface { io.WriteCloser Start() }
type CreateOperation ¶
type DaemonRunning ¶
type DaemonRunning struct { Message string `json:"message"` } //@name DaemonRunning
type Environment ¶
type Environment interface { // Execute Executes a command within the environment. Execute(steps ExecutionData) error // ExecuteAsync Executes a command within the environment and immediately return ExecuteAsync(steps ExecutionData) error // ExecuteInMainProcess Sends a string to the StdIn of the main program process ExecuteInMainProcess(cmd string) error // Kill Kills the main process, but leaves the environment running. Kill() error // Create Creates the environment setting needed to run programs. Create() error // Delete Deletes the environment. Delete() error Update() error IsRunning() (isRunning bool, err error) IsInstalling() bool SetInstalling(bool) WaitForMainProcess() error WaitForMainProcessFor(timeout time.Duration) error GetRootDirectory() string GetConsole() (console []byte, epoch int64) GetConsoleFrom(time int64) (console []byte, epoch int64) AddConsoleListener(ws *Socket) AddStatusListener(ws *Socket) AddStatsListener(ws *Socket) GetStats() (*ServerStats, error) DisplayToConsole(prefix bool, msg string, data ...interface{}) SendCode(code int) error GetBase() *BaseEnvironment GetLastExitCode() int GetWrapper() io.Writer GetStatsTracker() *Tracker }
type EnvironmentFactory ¶
type EnvironmentFactory interface { Create(id string) Environment Key() string }
type Error ¶
type Error struct { Message string `json:"msg,omitempty"` Code string `json:"code,omitempty"` Meta map[string]interface{} `json:"metadata,omitempty"` } //@name Error
func CreateErrMissingScope ¶
func CreateError ¶
func (*Error) GetMessage ¶
type ErrorResponse ¶
type ErrorResponse struct { Error *Error `json:"error"` } //@name ErrorResponse
type Execution ¶
type Execution struct { Command interface{} `json:"command"` StopCommand string `json:"stop,omitempty"` StopCode int `json:"stopCode,omitempty"` PreExecution []ConditionalMetadataType `json:"pre,omitempty"` PostExecution []ConditionalMetadataType `json:"post,omitempty"` EnvironmentVariables map[string]string `json:"environmentVars,omitempty"` WorkingDirectory string `json:"workingDirectory,omitempty"` Stdin StdinConsoleConfiguration `json:"stdin,omitempty"` AutoStart bool `json:"autostart"` AutoRestartFromCrash bool `json:"autorecover"` AutoRestartFromGraceful bool `json:"autorestart"` ExpectedExitCode int `json:"expectedExitCode,omitempty"` } //@name Execution
type ExecutionData ¶
type ExecutionFunction ¶
type ExecutionFunction func(steps ExecutionData) (err error)
type Filesystem ¶
type MemoryCache ¶
func CreateCache ¶
func CreateCache() *MemoryCache
func (*MemoryCache) Read ¶
func (c *MemoryCache) Read() (msg []byte, lastTime int64)
type MergedFS ¶
type MergedFS struct {
// contains filtered or unexported fields
}
func NewMergedFS ¶
type MetadataType ¶
type MetadataType struct { Type string `json:"type,omitempty"` Metadata map[string]interface{} `json:"-"` } //@name Metadata
MetadataType designed to be overridden
func (*MetadataType) MarshalJSON ¶
func (t *MetadataType) MarshalJSON() ([]byte, error)
func (*MetadataType) ParseMetadata ¶
func (t *MetadataType) ParseMetadata(target interface{}) error
ParseMetadata Parses the metadata into the target interface
func (*MetadataType) UnmarshalJSON ¶
func (t *MetadataType) UnmarshalJSON(bs []byte) error
UnmarshalJSON parses a type with this declaration, storing what it needs into metadata and type
type NoStartConsole ¶
type NoStartConsole struct { Console Base io.WriteCloser }
func (*NoStartConsole) Close ¶
func (nsc *NoStartConsole) Close() error
func (*NoStartConsole) Start ¶
func (nsc *NoStartConsole) Start()
type Operation ¶
type Operation interface {
Run(env Environment) OperationResult
}
type OperationFactory ¶
type OperationFactory interface { Create(CreateOperation) (Operation, error) Key() string }
type OperationResult ¶
type RCONConnection ¶
type RCONConnection struct { io.WriteCloser IP string Port string Password string Reconnect bool // contains filtered or unexported fields }
func (*RCONConnection) Close ¶
func (tc *RCONConnection) Close() error
func (*RCONConnection) Start ¶
func (tc *RCONConnection) Start()
type RCONWSConnection ¶
type RCONWSConnection struct { io.WriteCloser IP string Port string Password string Reconnect bool Environment Environment // contains filtered or unexported fields }
func (*RCONWSConnection) Close ¶
func (tc *RCONWSConnection) Close() error
func (*RCONWSConnection) Start ¶
func (tc *RCONWSConnection) Start()
type Requirements ¶
type Requirements struct { OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` Binaries []string `json:"binaries,omitempty"` } //@name Requirements
func (Requirements) Test ¶
func (r Requirements) Test(server Server) error
type SFTPAuthorization ¶
type SFTPAuthorization interface {
Validate(username, password string) (perms *ssh.Permissions, err error)
}
type Scope ¶
func RemoveScope ¶
func (*Scope) MarshalJSON ¶
func (*Scope) UnmarshalJSON ¶
type Server ¶
type Server struct { Type Identifier string `json:"id,omitempty"` Display string `json:"display,omitempty"` Icon string `json:"icon,omitempty"` Variables map[string]Variable `json:"data,omitempty"` Groups []Group `json:"groups,omitempty"` Installation []ConditionalMetadataType `json:"install,omitempty"` Uninstallation []ConditionalMetadataType `json:"uninstall,omitempty"` Execution Execution `json:"run"` Environment MetadataType `json:"environment"` SupportedEnvironments []MetadataType `json:"supportedEnvironments,omitempty"` Requirements Requirements `json:"requirements,omitempty"` } //@name ServerDefinition
type ServerData ¶
type ServerDataAdmin ¶
type ServerDataAdmin struct {
*Server
}
type ServerFlags ¶
type ServerIdResponse ¶
type ServerIdResponse struct { Id string `json:"id"` } //@name ServerId
type ServerLogs ¶
type ServerRunning ¶
type ServerStats ¶
type ServerTask ¶
type ServerTasks ¶
type ServerTasks struct { Tasks map[string]ServerTask } //@name ServerTasks
type Socket ¶
type Socket struct { io.WriteCloser // contains filtered or unexported fields }
type StdinConsoleConfiguration ¶
type StdinConsoleConfiguration struct { Type string `json:"type,omitempty"` IP string `json:"ip,omitempty"` Port string `json:"port,omitempty"` Password string `json:"password,omitempty"` } //@name StdinConsoleConfiguration
func (*StdinConsoleConfiguration) Replace ¶
func (c *StdinConsoleConfiguration) Replace(variables map[string]interface{}) StdinConsoleConfiguration
func (*StdinConsoleConfiguration) UnmarshalJSON ¶
func (v *StdinConsoleConfiguration) UnmarshalJSON(data []byte) error
type Task ¶
type Task struct { Name string `json:"name"` CronSchedule string `json:"cronSchedule"` Description string `json:"description,omitempty"` Operations []ConditionalMetadataType `json:"operations" binding:"required"` } //@name Task
type TelnetConnection ¶
type TelnetConnection struct { io.WriteCloser IP string Port string Password string Reconnect bool // contains filtered or unexported fields }
func (*TelnetConnection) Close ¶
func (tc *TelnetConnection) Close() error
func (*TelnetConnection) Start ¶
func (tc *TelnetConnection) Start()
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
func CreateTracker ¶
func CreateTracker() *Tracker
type Variable ¶
type Variable struct { Type Value interface{} `json:"value"` Display string `json:"display,omitempty"` Description string `json:"desc,omitempty"` Required bool `json:"required"` Internal bool `json:"internal,omitempty"` UserEditable bool `json:"userEdit"` Options []VariableOption `json:"options,omitempty"` } //@name Variable
func (*Variable) UnmarshalJSON ¶
type VariableOption ¶
type VariableOption struct { Value interface{} `json:"value"` Display string `json:"display"` } //@name VariableOption
Source Files ¶
- arguments.go
- authorization.go
- cache.go
- client.go
- close.go
- compression.go
- console.go
- conversion.go
- download.go
- engine.go
- environment.go
- environmentfactory.go
- errors.go
- files.go
- groups.go
- httpmodels.go
- interface.go
- mappings.go
- mergedfs.go
- operation.go
- rcon.go
- rconws.go
- scopes.go
- server.go
- telnet.go
- tracker.go
- typewithmetadata.go
- utils.go
- version.go
Click to show internal directories.
Click to hide internal directories.