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) 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 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 ¶ added in v0.9.1
type Allocation ¶
type AllocationDescriptor ¶ added in v0.9.1
type AppServer ¶ added in v0.9.1
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 ¶ added in v0.9.1
func (s *AppServer) BuildDescriptor() *ServerBuildDescriptor
func (*AppServer) DetailsDescriptor ¶ added in v0.9.1
func (s *AppServer) DetailsDescriptor() *ServerDetailsDescriptor
func (*AppServer) StartupDescriptor ¶ added in v0.9.1
func (s *AppServer) StartupDescriptor() *ServerStartupDescriptor
type Application ¶ added in v0.9.1
func NewApp ¶
func NewApp(url, key string) (*Application, error)
func (*Application) CreateLocation ¶ added in v0.9.1
func (a *Application) CreateLocation(short, long string) (*Location, error)
func (*Application) CreateNode ¶ added in v0.9.1
func (a *Application) CreateNode(fields CreateNodeDescriptor) (*Node, error)
func (*Application) CreateNodeAllocations ¶ added in v0.9.1
func (a *Application) CreateNodeAllocations(node int, fields CreateAllocationsDescriptor) error
func (*Application) CreateServer ¶ added in v0.9.1
func (a *Application) CreateServer(fields CreateServerDescriptor) (*AppServer, error)
func (*Application) CreateUser ¶ added in v0.9.1
func (a *Application) CreateUser(fields CreateUserDescriptor) (*User, error)
func (*Application) DeleteLocation ¶ added in v0.9.1
func (a *Application) DeleteLocation(id int) error
func (*Application) DeleteNode ¶ added in v0.9.1
func (a *Application) DeleteNode(id int) error
func (*Application) DeleteNodeAllocation ¶ added in v0.9.1
func (a *Application) DeleteNodeAllocation(node, id int) error
func (*Application) DeleteServer ¶ added in v0.9.1
func (a *Application) DeleteServer(id int, force bool) error
func (*Application) DeleteUser ¶ added in v0.9.1
func (a *Application) DeleteUser(id int) error
func (*Application) GetDeployableNodes ¶ added in v0.9.1
func (a *Application) GetDeployableNodes(fields DeployableNodesDescriptor) ([]*Node, error)
func (*Application) GetLocation ¶ added in v0.9.1
func (a *Application) GetLocation(id int) (*Location, error)
func (*Application) GetLocations ¶ added in v0.9.1
func (a *Application) GetLocations() ([]*Location, error)
func (*Application) GetNodeAllocations ¶ added in v0.9.1
func (a *Application) GetNodeAllocations(node int) ([]*Allocation, error)
func (*Application) GetNodeConfiguration ¶ added in v0.9.1
func (a *Application) GetNodeConfiguration(id int) (*NodeConfiguration, error)
func (*Application) GetNodes ¶ added in v0.9.1
func (a *Application) GetNodes() ([]*Node, error)
func (*Application) GetServer ¶ added in v0.9.1
func (a *Application) GetServer(id int) (*AppServer, error)
func (*Application) GetServerExternal ¶ added in v0.9.1
func (a *Application) GetServerExternal(id string) (*AppServer, error)
func (*Application) GetServers ¶ added in v0.9.1
func (a *Application) GetServers() ([]*AppServer, error)
func (*Application) GetUserExternal ¶ added in v0.9.1
func (a *Application) GetUserExternal(id string) (*User, error)
func (*Application) GetUsers ¶ added in v0.9.1
func (a *Application) GetUsers() ([]*User, error)
func (*Application) SuspendServer ¶ added in v0.9.1
func (a *Application) SuspendServer(id int) error
func (*Application) UnsuspendServer ¶ added in v0.9.1
func (a *Application) UnsuspendServer(id int) error
func (*Application) UpdateLocation ¶ added in v0.9.1
func (a *Application) UpdateLocation(id int, short, long string) (*Location, error)
func (*Application) UpdateNode ¶ added in v0.9.1
func (a *Application) UpdateNode(id int, fields UpdateNodeDescriptor) (*Node, error)
func (*Application) UpdateServerBuild ¶ added in v0.9.1
func (a *Application) UpdateServerBuild(id int, fields ServerBuildDescriptor) (*AppServer, error)
func (*Application) UpdateServerDetails ¶ added in v0.9.1
func (a *Application) UpdateServerDetails(id int, fields ServerDetailsDescriptor) (*AppServer, error)
func (*Application) UpdateServerStartup ¶ added in v0.9.1
func (a *Application) UpdateServerStartup(id int, fields ServerStartupDescriptor) (*AppServer, error)
func (*Application) UpdateUser ¶ added in v0.9.1
func (a *Application) UpdateUser(id int, fields UpdateUserDescriptor) (*User, error)
type ChmodDescriptor ¶ added in v0.9.1
type Client ¶ added in v0.9.1
func (*Client) ChmodServerFiles ¶ added in v0.9.1
func (c *Client) ChmodServerFiles(identifier string, files ChmodDescriptor) error
func (*Client) CompressServerFiles ¶ added in v0.9.1
func (c *Client) CompressServerFiles(identifier string, files CompressDescriptor) error
func (*Client) CopyServerFile ¶ added in v0.9.1
func (*Client) CreateDatabase ¶ added in v0.9.1
func (c *Client) CreateDatabase(identifier, remote, database string) (*ClientDatabase, error)
func (*Client) CreateServerFileFolder ¶ added in v0.9.1
func (c *Client) CreateServerFileFolder(identifier string, file CreateFolderDescriptor) error
func (*Client) DecompressServerFile ¶ added in v0.9.1
func (c *Client) DecompressServerFile(identifier string, file DecompressDescriptor) error
func (*Client) DeleteDatabase ¶ added in v0.9.1
func (*Client) DeleteServerFiles ¶ added in v0.9.1
func (c *Client) DeleteServerFiles(identifier string, files DeleteFilesDescriptor) error
func (*Client) DisableTwoFactor ¶ added in v0.9.1
func (*Client) DownloadServerFile ¶ added in v0.9.1
func (c *Client) DownloadServerFile(identifier, file string) (*Downloader, error)
func (*Client) EnableTwoFactor ¶ added in v0.9.1
func (*Client) GetAccount ¶ added in v0.9.1
func (*Client) GetApiKeys ¶ added in v0.9.1
func (*Client) GetServer ¶ added in v0.9.1
func (c *Client) GetServer(identifier string) (*ClientServer, error)
func (*Client) GetServerDatabases ¶ added in v0.9.1
func (c *Client) GetServerDatabases(identifier string) ([]*ClientDatabase, error)
func (*Client) GetServerFileContents ¶ added in v0.9.1
func (*Client) GetServerFiles ¶ added in v0.9.1
func (*Client) GetServerResources ¶ added in v0.9.1
func (*Client) GetServerWebSocket ¶ added in v0.9.1
func (c *Client) GetServerWebSocket(identifier string) (*WebSocketAuth, error)
func (*Client) GetServers ¶ added in v0.9.1
func (c *Client) GetServers() ([]*ClientServer, error)
func (*Client) GetTwoFactor ¶ added in v0.9.1
func (c *Client) GetTwoFactor() (*TwoFactorData, error)
func (*Client) PullServerFile ¶ added in v0.9.1
func (c *Client) PullServerFile(identifier string, file PullDescriptor) error
func (*Client) RenameServerFiles ¶ added in v0.9.1
func (c *Client) RenameServerFiles(identifier string, files RenameDescriptor) error
func (*Client) RotateDatabasePassword ¶ added in v0.9.1
func (c *Client) RotateDatabasePassword(identifier, id string) (*ClientDatabase, error)
func (*Client) SendServerCommand ¶ added in v0.9.1
func (*Client) SetServerPowerState ¶ added in v0.9.1
func (*Client) UpdateEmail ¶ added in v0.9.1
func (*Client) UpdatePassword ¶ added in v0.9.1
func (*Client) UploadServerFile ¶ added in v0.9.1
func (*Client) WriteServerFile ¶ added in v0.9.1
type ClientDatabase ¶ added in v0.9.1
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 ¶ added in v0.9.1
type CreateAllocationsDescriptor ¶ added in v0.9.1
type CreateFolderDescriptor ¶ added in v0.9.1
type CreateNodeDescriptor ¶ added in v0.9.1
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 ¶ added in v0.9.1
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 ¶ added in v0.9.1
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 ¶ added in v0.9.1
type DeleteFilesDescriptor ¶ added in v0.9.1
type DeployDescriptor ¶ added in v0.9.1
type DeployableNodesDescriptor ¶ added in v0.9.1
type Downloader ¶ added in v0.9.1
func (*Downloader) Client ¶ added in v0.9.1
func (d *Downloader) Client() *Client
func (*Downloader) Execute ¶ added in v0.9.1
func (d *Downloader) Execute() error
func (*Downloader) URL ¶ added in v0.9.1
func (d *Downloader) URL() string
type Error ¶
type FeatureLimits ¶ added in v0.9.1
type File ¶ added in v0.9.1
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 ¶ added in v0.9.1
func (n *Node) UpdateDescriptor() *UpdateNodeDescriptor
type NodeConfiguration ¶ added in v0.9.1
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 ¶ added in v0.9.1
type RenameDescriptor ¶ added in v0.9.1
type ResourceUsage ¶ added in v0.9.1
type Resources ¶ added in v0.9.1
type Resources struct { State string `json:"current_state,omitempty"` Suspended bool `json:"is_suspended"` Usage ResourceUsage `json:"resources"` }
type ServerBuildDescriptor ¶ added in v0.9.1
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 ¶ added in v0.9.1
type ServerStartupDescriptor ¶ added in v0.9.1
type TwoFactorData ¶ added in v0.9.1
type UpdateNodeDescriptor ¶ added in v0.9.1
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 ¶ added in v0.9.1
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 Uploader ¶ added in v0.9.1
type Uploader struct { Path string // contains filtered or unexported fields }
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 ¶ added in v0.9.1
func (u *User) UpdateDescriptor() *UpdateUserDescriptor
type WebSocketAuth ¶ added in v0.9.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.