Documentation ¶
Index ¶
- Constants
- type Account
- type Allocation
- type AllocationDescriptor
- type ApiError
- type ApiKey
- type AppServer
- type Application
- func (a *Application) CreateLocation(short, long string) (*Location, error)
- func (a *Application) CreateNode(fields CreateNodeDescriptor) (*Node, error)
- func (a *Application) CreateNodeAllocations(node int, fields CreateAllocationsDescriptor) error
- func (a *Application) CreateServer(fields CreateServerDescriptor) (*AppServer, error)
- func (a *Application) CreateUser(fields CreateUserDescriptor) (*User, error)
- func (a *Application) DeleteLocation(id int) error
- func (a *Application) DeleteNode(id int) error
- func (a *Application) DeleteNodeAllocation(node, id int) error
- func (a *Application) DeleteServer(id int, force bool) error
- func (a *Application) DeleteUser(id int) error
- func (a *Application) GetDeployableNodes(fields DeployableNodesDescriptor) ([]*Node, error)
- func (a *Application) GetEgg(nestId int, eggId int) (*Egg, error)
- func (a *Application) GetLocation(id int) (*Location, error)
- func (a *Application) GetLocations() ([]*Location, error)
- func (a *Application) GetNode(id int) (*Node, error)
- func (a *Application) GetNodeAllocations(node int) ([]*Allocation, error)
- func (a *Application) GetNodeConfiguration(id int) (*NodeConfiguration, error)
- func (a *Application) GetNodes() ([]*Node, error)
- func (a *Application) GetServer(id int) (*AppServer, error)
- func (a *Application) GetServerExternal(id string) (*AppServer, error)
- func (a *Application) GetServers() ([]*AppServer, error)
- func (a *Application) GetUser(id int) (*User, error)
- func (a *Application) GetUserExternal(id string) (*User, error)
- func (a *Application) GetUsers() ([]*User, error)
- func (a *Application) SuspendServer(id int) error
- func (a *Application) UnsuspendServer(id int) error
- func (a *Application) UpdateLocation(id int, short, long string) (*Location, error)
- func (a *Application) UpdateNode(id int, fields UpdateNodeDescriptor) (*Node, error)
- func (a *Application) UpdateServerBuild(id int, fields ServerBuildDescriptor) (*AppServer, error)
- func (a *Application) UpdateServerDetails(id int, fields ServerDetailsDescriptor) (*AppServer, error)
- func (a *Application) UpdateServerStartup(id int, fields ServerStartupDescriptor) (*AppServer, error)
- func (a *Application) UpdateUser(id int, fields UpdateUserDescriptor) (*User, error)
- type ChmodDescriptor
- type Client
- func (c *Client) ChmodServerFiles(identifier string, files ChmodDescriptor) error
- func (c *Client) CompressServerFiles(identifier string, files CompressDescriptor) error
- func (c *Client) CopyServerFile(identifier, location string) error
- func (c *Client) CreateDatabase(identifier, remote, database string) (*ClientDatabase, error)
- func (c *Client) CreateKey(description string, ips []string) (*ApiKey, error)
- func (c *Client) CreateServerFileFolder(identifier string, file CreateFolderDescriptor) error
- func (c *Client) DecompressServerFile(identifier string, file DecompressDescriptor) error
- func (c *Client) DeleteDatabase(identifier, id string) error
- func (c *Client) DeleteKey(identifier string) error
- func (c *Client) DeleteServerFiles(identifier string, files DeleteFilesDescriptor) error
- func (c *Client) DisableTwoFactor(password string) error
- func (c *Client) DownloadServerFile(identifier, file string) (*Downloader, error)
- func (c *Client) EnableTwoFactor(code int) ([]string, error)
- func (c *Client) GetAccount() (*Account, error)
- func (c *Client) GetApiKeys() ([]*ApiKey, error)
- func (c *Client) GetServer(identifier string) (*ClientServer, error)
- func (c *Client) GetServerDatabases(identifier string) ([]*ClientDatabase, error)
- func (c *Client) GetServerFileContents(identifier, file string) ([]byte, error)
- func (c *Client) GetServerFiles(identififer, root string) ([]*File, error)
- func (c *Client) GetServerResources(identifier string) (*Resources, error)
- func (c *Client) GetServerWebSocket(identifier string) (*WebSocketAuth, error)
- func (c *Client) GetServers() ([]*ClientServer, error)
- func (c *Client) GetTwoFactor() (*TwoFactorData, error)
- func (c *Client) PullServerFile(identifier string, file PullDescriptor) error
- func (c *Client) RenameServerFiles(identifier string, files RenameDescriptor) error
- func (c *Client) RotateDatabasePassword(identifier, id string) (*ClientDatabase, error)
- func (c *Client) SendServerCommand(identifier, command string) error
- func (c *Client) SetServerPowerState(identifier, state string) error
- func (c *Client) UpdateEmail(email, password string) error
- func (c *Client) UpdatePassword(old, new string) error
- func (c *Client) UploadServerFile(identifier, path string) (*Uploader, error)
- func (c *Client) WriteServerFile(identifier, name, content string) error
- func (c *Client) WriteServerFileBytes(identifier, name, header string, content []byte) error
- type ClientDatabase
- type ClientServer
- type CompressDescriptor
- type CreateAllocationsDescriptor
- type CreateFolderDescriptor
- type CreateNodeDescriptor
- type CreateServerDescriptor
- type CreateUserDescriptor
- type DecompressDescriptor
- type DeleteFilesDescriptor
- type DeployDescriptor
- type DeployableNodesDescriptor
- type Downloader
- type Egg
- type Error
- type FeatureLimits
- type File
- type Limits
- type Location
- type Node
- type NodeConfiguration
- type PullDescriptor
- type RenameDescriptor
- type ResourceUsage
- type Resources
- type ServerBuildDescriptor
- type ServerDetailsDescriptor
- type ServerStartupDescriptor
- type TwoFactorData
- type UpdateNodeDescriptor
- type UpdateUserDescriptor
- type Uploader
- type User
- type WebSocketAuth
Constants ¶
View Source
const Version = "1.0.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Allocation ¶
type AllocationDescriptor ¶
type AppServer ¶
type AppServer struct { ID int `json:"id"` ExternalID string `json:"external_id"` UUID string `json:"uuid"` Identifier string `json:"identifier"` Name string `json:"name"` Description string `json:"description"` Status string `json:"status,omitempty"` Suspended bool `json:"suspended"` Limits Limits `json:"limits"` FeatureLimits FeatureLimits `json:"feature_limits"` User int `json:"user"` Node int `json:"node"` Allocation int `json:"allocation"` Nest int `json:"nest"` Egg int `json:"egg"` Container struct { StartupCommand string `json:"startup_command"` Image string `json:"image"` Installed int `json:"installed"` Environment map[string]interface{} `json:"environment"` } `json:"container"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
func (*AppServer) BuildDescriptor ¶
func (s *AppServer) BuildDescriptor() *ServerBuildDescriptor
func (*AppServer) DetailsDescriptor ¶
func (s *AppServer) DetailsDescriptor() *ServerDetailsDescriptor
func (*AppServer) StartupDescriptor ¶
func (s *AppServer) StartupDescriptor() *ServerStartupDescriptor
type Application ¶
func NewApp ¶
func NewApp(url, key string) (*Application, error)
func (*Application) CreateLocation ¶
func (a *Application) CreateLocation(short, long string) (*Location, error)
func (*Application) CreateNode ¶
func (a *Application) CreateNode(fields CreateNodeDescriptor) (*Node, error)
func (*Application) CreateNodeAllocations ¶
func (a *Application) CreateNodeAllocations(node int, fields CreateAllocationsDescriptor) error
func (*Application) CreateServer ¶
func (a *Application) CreateServer(fields CreateServerDescriptor) (*AppServer, error)
func (*Application) CreateUser ¶
func (a *Application) CreateUser(fields CreateUserDescriptor) (*User, error)
func (*Application) DeleteLocation ¶
func (a *Application) DeleteLocation(id int) error
func (*Application) DeleteNode ¶
func (a *Application) DeleteNode(id int) error
func (*Application) DeleteNodeAllocation ¶
func (a *Application) DeleteNodeAllocation(node, id int) error
func (*Application) DeleteServer ¶
func (a *Application) DeleteServer(id int, force bool) error
func (*Application) DeleteUser ¶
func (a *Application) DeleteUser(id int) error
func (*Application) GetDeployableNodes ¶
func (a *Application) GetDeployableNodes(fields DeployableNodesDescriptor) ([]*Node, error)
func (*Application) GetLocation ¶
func (a *Application) GetLocation(id int) (*Location, error)
func (*Application) GetLocations ¶
func (a *Application) GetLocations() ([]*Location, error)
func (*Application) GetNodeAllocations ¶
func (a *Application) GetNodeAllocations(node int) ([]*Allocation, error)
func (*Application) GetNodeConfiguration ¶
func (a *Application) GetNodeConfiguration(id int) (*NodeConfiguration, error)
func (*Application) GetNodes ¶
func (a *Application) GetNodes() ([]*Node, error)
func (*Application) GetServerExternal ¶
func (a *Application) GetServerExternal(id string) (*AppServer, error)
func (*Application) GetServers ¶
func (a *Application) GetServers() ([]*AppServer, error)
func (*Application) GetUserExternal ¶
func (a *Application) GetUserExternal(id string) (*User, error)
func (*Application) GetUsers ¶
func (a *Application) GetUsers() ([]*User, error)
func (*Application) SuspendServer ¶
func (a *Application) SuspendServer(id int) error
func (*Application) UnsuspendServer ¶
func (a *Application) UnsuspendServer(id int) error
func (*Application) UpdateLocation ¶
func (a *Application) UpdateLocation(id int, short, long string) (*Location, error)
func (*Application) UpdateNode ¶
func (a *Application) UpdateNode(id int, fields UpdateNodeDescriptor) (*Node, error)
func (*Application) UpdateServerBuild ¶
func (a *Application) UpdateServerBuild(id int, fields ServerBuildDescriptor) (*AppServer, error)
func (*Application) UpdateServerDetails ¶
func (a *Application) UpdateServerDetails(id int, fields ServerDetailsDescriptor) (*AppServer, error)
func (*Application) UpdateServerStartup ¶
func (a *Application) UpdateServerStartup(id int, fields ServerStartupDescriptor) (*AppServer, error)
func (*Application) UpdateUser ¶
func (a *Application) UpdateUser(id int, fields UpdateUserDescriptor) (*User, error)
type ChmodDescriptor ¶
type Client ¶
func (*Client) ChmodServerFiles ¶
func (c *Client) ChmodServerFiles(identifier string, files ChmodDescriptor) error
func (*Client) CompressServerFiles ¶
func (c *Client) CompressServerFiles(identifier string, files CompressDescriptor) error
func (*Client) CopyServerFile ¶
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(identifier, remote, database string) (*ClientDatabase, error)
func (*Client) CreateServerFileFolder ¶
func (c *Client) CreateServerFileFolder(identifier string, file CreateFolderDescriptor) error
func (*Client) DecompressServerFile ¶
func (c *Client) DecompressServerFile(identifier string, file DecompressDescriptor) error
func (*Client) DeleteDatabase ¶
func (*Client) DeleteServerFiles ¶
func (c *Client) DeleteServerFiles(identifier string, files DeleteFilesDescriptor) error
func (*Client) DisableTwoFactor ¶
func (*Client) DownloadServerFile ¶
func (c *Client) DownloadServerFile(identifier, file string) (*Downloader, error)
func (*Client) GetAccount ¶
func (*Client) GetApiKeys ¶
func (*Client) GetServerDatabases ¶
func (c *Client) GetServerDatabases(identifier string) ([]*ClientDatabase, error)
func (*Client) GetServerFileContents ¶
func (*Client) GetServerFiles ¶
func (*Client) GetServerResources ¶
func (*Client) GetServerWebSocket ¶
func (c *Client) GetServerWebSocket(identifier string) (*WebSocketAuth, error)
func (*Client) GetServers ¶
func (c *Client) GetServers() ([]*ClientServer, error)
func (*Client) GetTwoFactor ¶
func (c *Client) GetTwoFactor() (*TwoFactorData, error)
func (*Client) PullServerFile ¶
func (c *Client) PullServerFile(identifier string, file PullDescriptor) error
func (*Client) RenameServerFiles ¶
func (c *Client) RenameServerFiles(identifier string, files RenameDescriptor) error
func (*Client) RotateDatabasePassword ¶
func (c *Client) RotateDatabasePassword(identifier, id string) (*ClientDatabase, error)
func (*Client) SendServerCommand ¶
func (*Client) SetServerPowerState ¶
func (*Client) UpdateEmail ¶
func (*Client) UpdatePassword ¶
func (*Client) UploadServerFile ¶
func (*Client) WriteServerFile ¶
type ClientDatabase ¶
type ClientServer ¶
type ClientServer struct { ServerOwner bool `json:"server_owner"` Identifier string `json:"identifier"` UUID string `json:"uuid"` InternalID int `json:"internal_id"` Name string `json:"name"` Node string `json:"node"` SFTP struct { IP string `json:"ip"` Port int64 `json:"port"` } `json:"sftp_details"` Description string `json:"description"` Limits Limits `json:"limits"` Invocation string `json:"invocation"` DockerImage string `json:"docker_image"` EggFeatures []string `json:"egg_features"` FeatureLimits FeatureLimits `json:"feature_limits"` Status string `json:"status"` Suspended bool `json:"is_suspended"` Installing bool `json:"is_installing"` Transferring bool `json:"is_transferring"` }
type CompressDescriptor ¶
type CreateFolderDescriptor ¶
type CreateNodeDescriptor ¶
type CreateNodeDescriptor struct { Name string `json:"name"` Description string `json:"description"` LocationID int `json:"location_id"` Public bool `json:"public"` FQDN string `json:"fqdn"` Scheme string `json:"scheme"` BehindProxy bool `json:"behind_proxy"` Memory int64 `json:"memory"` MemoryOverallocate int64 `json:"memory_overallocate"` Disk int64 `json:"disk"` DiskOverallocate int64 `json:"disk_overallocate"` DaemonBase string `json:"daemon_base"` DaemonSftp int32 `json:"daemon_sftp"` DaemonListen int32 `json:"daemon_listen"` UploadSize int64 `json:"upload_size"` }
type CreateServerDescriptor ¶
type CreateServerDescriptor struct { ExternalID string `json:"external_id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` User int `json:"user"` Egg int `json:"egg"` DockerImage string `json:"docker_image"` Startup string `json:"startup"` Environment map[string]interface{} `json:"environment"` SkipScripts bool `json:"skip_scripts,omitempty"` OOMDisabled bool `json:"oom_disabled"` Limits *Limits `json:"limits"` FeatureLimtis FeatureLimits `json:"feature_limits"` Allocation *AllocationDescriptor `json:"allocation,omitempty"` Deploy *DeployDescriptor `json:"deploy,omitempty"` StartOnCompletion bool `json:"start_on_completion,omitempty"` }
type CreateUserDescriptor ¶
type CreateUserDescriptor struct { ExternalID string `json:"external_id,omitempty"` Email string `json:"email"` Username string `json:"username"` Password string `json:"password,omitempty"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Language string `json:"language,omitempty"` RootAdmin bool `json:"root_admin,omitempty"` }
type DecompressDescriptor ¶
type DeleteFilesDescriptor ¶
type DeployDescriptor ¶
type Downloader ¶
func (*Downloader) Client ¶
func (d *Downloader) Client() *Client
func (*Downloader) Execute ¶
func (d *Downloader) Execute() error
func (*Downloader) URL ¶
func (d *Downloader) URL() string
type Egg ¶
type Egg struct { Id int `json:"id"` Uuid string `json:"uuid"` Name string `json:"name"` Nest int `json:"nest"` Author string `json:"author"` Description string `json:"description"` DockerImage string `json:"docker_image"` DockerImages map[string]string `json:"docker_images"` Config *struct { Files map[string]interface{} `json:"files"` Startup struct { Done string `json:"done"` UserInteraction []string `json:"userInteraction"` } `json:"startup"` Stop string `json:"stop"` Logs interface{} `json:"logs"` FileDenylist []interface{} `json:"file_denylist"` Extends interface{} `json:"extends"` } `json:"config"` Startup string `json:"startup"` Script struct { Privileged bool `json:"privileged"` Install string `json:"install"` Entry string `json:"entry"` Container string `json:"container"` Extends interface{} `json:"extends"` } `json:"script"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Relationships struct { //Nest struct { // Object string `json:"object"` // Attributes struct { // Id int `json:"id"` // Uuid string `json:"uuid"` // Author string `json:"author"` // Name string `json:"name"` // Description string `json:"description"` // CreatedAt time.Time `json:"created_at"` // UpdatedAt time.Time `json:"updated_at"` // } `json:"attributes"` //} `json:"nest"` //Servers struct { // Object string `json:"object"` // Data []interface{} `json:"data"` //} `json:"servers"` Variables struct { Object string `json:"object"` Data []struct { Object string `json:"object"` Attributes struct { Id int `json:"id"` EggId int `json:"egg_id"` Name string `json:"name"` Description string `json:"description"` EnvVariable string `json:"env_variable"` DefaultValue string `json:"default_value"` UserViewable bool `json:"user_viewable"` UserEditable bool `json:"user_editable"` Rules string `json:"rules"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } `json:"attributes"` } `json:"data"` } `json:"variables"` } `json:"relationships"` }
type Error ¶
type FeatureLimits ¶
type File ¶
type File struct { Name string `json:"name"` Mode string `json:"mode"` ModeBits string `json:"mode_bits"` Size int64 `json:"size"` IsFile bool `json:"is_file"` IsSymlink bool `json:"is_symlink"` MimeType string `json:"mimetype"` CreatedAt *time.Time `json:"created_at"` ModifiedAt *time.Time `json:"modified_at,omitempty"` }
type Node ¶
type Node struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` LocationID int `json:"location_id"` Public bool `json:"public"` FQDN string `json:"fqdn"` Scheme string `json:"scheme"` BehindProxy bool `json:"behind_proxy"` Memory int64 `json:"memory"` MemoryOverallocate int64 `json:"memory_overallocate"` Disk int64 `json:"disk"` DiskOverallocate int64 `json:"disk_overallocate"` DaemonBase string `json:"daemon_base"` DaemonSftp int32 `json:"daemon_sftp"` DaemonListen int32 `json:"daemon_listen"` MaintenanceMode bool `json:"maintenance_mode"` UploadSize int64 `json:"upload_size"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
func (*Node) UpdateDescriptor ¶
func (n *Node) UpdateDescriptor() *UpdateNodeDescriptor
type NodeConfiguration ¶
type NodeConfiguration struct { Debug bool `json:"debug"` UUID string `json:"uuid"` TokenID string `json:"token_id"` Token string `json:"token"` API struct { Host string `json:"host"` Port int32 `json:"port"` SSL struct { Enabled bool `json:"enabled"` Cert string `json:"cert"` Key string `json:"key"` } `json:"ssl"` UploadLimit int64 `json:"upload_limit"` } `json:"api"` System struct { Data string `json:"data"` SFTP struct { BindPort int32 `json:"bind_port"` } `json:"sftp"` } `json:"system"` AllowedMounts []string `json:"allowed_mounts"` Remote string `json:"remote"` }
type PullDescriptor ¶
type RenameDescriptor ¶
type ResourceUsage ¶
type Resources ¶
type Resources struct { State string `json:"current_state,omitempty"` Suspended bool `json:"is_suspended"` Usage ResourceUsage `json:"resources"` }
type ServerBuildDescriptor ¶
type ServerBuildDescriptor struct { Allocation int `json:"allocation,omitempty"` OOMDisabled bool `json:"oom_disabled,omitempty"` Limits Limits `json:"limits,omitempty"` AddAllocations []int `json:"add_allocations,omitempty"` RemoveAllocations []int `json:"remove_allocations,omitempty"` FeatureLimits FeatureLimits `json:"feature_limits,omitempty"` }
type ServerDetailsDescriptor ¶
type ServerStartupDescriptor ¶
type TwoFactorData ¶
type UpdateNodeDescriptor ¶
type UpdateNodeDescriptor struct { Name string `json:"name"` Description string `json:"description"` LocationID int `json:"location_id"` Public bool `json:"public"` FQDN string `json:"fqdn"` Scheme string `json:"scheme"` BehindProxy bool `json:"behind_proxy"` Memory int64 `json:"memory"` MemoryOverallocate int64 `json:"memory_overallocate"` Disk int64 `json:"disk"` DiskOverallocate int64 `json:"disk_overallocate"` DaemonBase string `json:"daemon_base"` DaemonSftp int32 `json:"daemon_sftp"` DaemonListen int32 `json:"daemon_listen"` UploadSize int64 `json:"upload_size"` }
type UpdateUserDescriptor ¶
type UpdateUserDescriptor struct { ExternalID string `json:"external_id,omitempty"` Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Language string `json:"language,omitempty"` RootAdmin bool `json:"root_admin,omitempty"` }
type User ¶
type User struct { ID int `json:"id"` ExternalID string `json:"external_id"` UUID string `json:"uuid"` Username string `json:"username"` Email string `json:"email"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Language string `json:"language"` RootAdmin bool `json:"root_admin"` TwoFactor bool `json:"2fa"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
func (*User) UpdateDescriptor ¶
func (u *User) UpdateDescriptor() *UpdateUserDescriptor
type WebSocketAuth ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.