Documentation
¶
Index ¶
- type NexusClient
- func (nc *NexusClient) Authenticate(user, pwd string) (string, error)
- func (nc *NexusClient) AuthenticateWithToken(token string) error
- func (nc *NexusClient) CheckRemoteViewer() error
- func (nc *NexusClient) Cleanup()
- func (nc *NexusClient) GetAttachVMsCreds() ([]vm.VMAttachCredentialsSerialized, error)
- func (nc *NexusClient) GetHostname() string
- func (nc *NexusClient) GetServerVersion() (*params.Version, error)
- func (nc *NexusClient) GetTemplate(uuid string) (*template.TemplateSerialized, error)
- func (nc *NexusClient) GetTemplates() ([]template.TemplateSerialized, error)
- func (nc *NexusClient) GetUser(email string) (*params.UserWithoutPwd, error)
- func (nc *NexusClient) GetUsers() ([]params.UserWithoutPwd, error)
- func (nc *NexusClient) GetVM(vmID string) (*vm.VMNetworkSerialized, error)
- func (nc *NexusClient) GetVMActions(v *vm.VMNetworkSerialized) caps.VMActions
- func (nc *NexusClient) GetVMs() ([]vm.VMNetworkSerialized, error)
- func (nc *NexusClient) RefreshToken() error
- func (nc *NexusClient) SetTimeout(timeout time.Duration)
- func (nc *NexusClient) TemplateCreate(vmID uuid.UUID, name, access string) (*template.TemplateSerialized, error)
- func (nc *NexusClient) TemplateDel(tplID string) error
- func (nc *NexusClient) TemplateEdit(tplID string, p params.TplEdit) (*template.TemplateSerialized, error)
- func (nc *NexusClient) TemplateExportDisk(tplID, outputFile string) error
- func (nc *NexusClient) UserCreate(p params.UserWithPwd) (*params.UserWithoutPwd, error)
- func (nc *NexusClient) UserDelete(email string) error
- func (nc *NexusClient) UserResetPwd(email string) (string, error)
- func (nc *NexusClient) UserSetCaps(email string, userCaps *params.UserSetCaps) error
- func (nc *NexusClient) UserUnlock(email string) error
- func (nc *NexusClient) UserUpdatePwd(newPwd string) error
- func (nc *NexusClient) UserWhoAmI() (*params.UserWithoutPwd, error)
- func (nc *NexusClient) VMAddAccess(vmID, vmName, email string, vmAccessCaps *params.VMAddAccess) error
- func (nc *NexusClient) VMAttachFromCreds(v vm.VMAttachCredentialsSerialized, fullscreen bool) error
- func (nc *NexusClient) VMAttachFromID(vmID string, fullscreen bool) error
- func (nc *NexusClient) VMAttachFromPwd(pwd string, fullscreen bool) error
- func (nc *NexusClient) VMCreate(p params.VMCreate) (*vm.VMNetworkSerialized, error)
- func (nc *NexusClient) VMDel(vmID string) error
- func (nc *NexusClient) VMDelAccess(vmID, vmName, email string) error
- func (nc *NexusClient) VMEdit(vmID string, p params.VMEdit) (*vm.VMNetworkSerialized, error)
- func (nc *NexusClient) VMExportDir(vmName, vmID, dirToExport string) (string, error)
- func (nc *NexusClient) VMImportArchive(vmID, vmDir, archiveFile string) error
- func (nc *NexusClient) VMReboot(vmID string) error
- func (nc *NexusClient) VMShutdown(vmID string) error
- func (nc *NexusClient) VMStart(vmID string) error
- func (nc *NexusClient) VMStartWithCreds(vmID string, p params.VMStartWithCreds) error
- func (nc *NexusClient) VMStop(vmID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NexusClient ¶
type NexusClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(host string) (*NexusClient, error)
The host argument has the following format: "ip:port" or "domain:port", e.g. "127.0.0.1:1077" or "my.domain.net:80"
func (*NexusClient) Authenticate ¶
func (nc *NexusClient) Authenticate(user, pwd string) (string, error)
Authenticate a user. curl -X POST https://localhost:8000/login -H 'Content-Type: application/json' -d '{"email": "janedoe@nexus.org", "pwd":"pipomolo"}' Returns an JWT token if authentication succeeded or an error if it failed. IMPORTANT: caller MUST call the Cleanup() function before exiting!
func (*NexusClient) AuthenticateWithToken ¶
func (nc *NexusClient) AuthenticateWithToken(token string) error
"Authenticate" by using an already established connection using a previously received token (typically with the Authenticate method). IMPORTANT: caller MUST call the Cleanup() function before exiting!
func (*NexusClient) CheckRemoteViewer ¶
func (nc *NexusClient) CheckRemoteViewer() error
func (*NexusClient) Cleanup ¶
func (nc *NexusClient) Cleanup()
Cleanup resources allocated by Authenticate and AuthenticateWithToken. IMPORTANT: caller MUST call this function before exiting!
func (*NexusClient) GetAttachVMsCreds ¶
func (nc *NexusClient) GetAttachVMsCreds() ([]vm.VMAttachCredentialsSerialized, error)
func (*NexusClient) GetHostname ¶
func (nc *NexusClient) GetHostname() string
Returns the hostname, e.g. "127.0.0.1" or "my.domain.net".
func (*NexusClient) GetServerVersion ¶
func (nc *NexusClient) GetServerVersion() (*params.Version, error)
func (*NexusClient) GetTemplate ¶
func (nc *NexusClient) GetTemplate(uuid string) (*template.TemplateSerialized, error)
func (*NexusClient) GetTemplates ¶
func (nc *NexusClient) GetTemplates() ([]template.TemplateSerialized, error)
func (*NexusClient) GetUser ¶
func (nc *NexusClient) GetUser(email string) (*params.UserWithoutPwd, error)
func (*NexusClient) GetUsers ¶
func (nc *NexusClient) GetUsers() ([]params.UserWithoutPwd, error)
func (*NexusClient) GetVM ¶
func (nc *NexusClient) GetVM(vmID string) (*vm.VMNetworkSerialized, error)
func (*NexusClient) GetVMActions ¶
func (nc *NexusClient) GetVMActions(v *vm.VMNetworkSerialized) caps.VMActions
func (*NexusClient) GetVMs ¶
func (nc *NexusClient) GetVMs() ([]vm.VMNetworkSerialized, error)
func (*NexusClient) RefreshToken ¶
func (nc *NexusClient) RefreshToken() error
Obtain a new JWT token from the server.
func (*NexusClient) SetTimeout ¶
func (nc *NexusClient) SetTimeout(timeout time.Duration)
Change the default timeout.
func (*NexusClient) TemplateCreate ¶
func (nc *NexusClient) TemplateCreate(vmID uuid.UUID, name, access string) (*template.TemplateSerialized, error)
func (*NexusClient) TemplateDel ¶
func (nc *NexusClient) TemplateDel(tplID string) error
func (*NexusClient) TemplateEdit ¶
func (nc *NexusClient) TemplateEdit(tplID string, p params.TplEdit) (*template.TemplateSerialized, error)
func (*NexusClient) TemplateExportDisk ¶
func (nc *NexusClient) TemplateExportDisk(tplID, outputFile string) error
func (*NexusClient) UserCreate ¶
func (nc *NexusClient) UserCreate(p params.UserWithPwd) (*params.UserWithoutPwd, error)
func (*NexusClient) UserDelete ¶
func (nc *NexusClient) UserDelete(email string) error
func (*NexusClient) UserResetPwd ¶
func (nc *NexusClient) UserResetPwd(email string) (string, error)
func (*NexusClient) UserSetCaps ¶
func (nc *NexusClient) UserSetCaps(email string, userCaps *params.UserSetCaps) error
func (*NexusClient) UserUnlock ¶
func (nc *NexusClient) UserUnlock(email string) error
func (*NexusClient) UserUpdatePwd ¶
func (nc *NexusClient) UserUpdatePwd(newPwd string) error
func (*NexusClient) UserWhoAmI ¶
func (nc *NexusClient) UserWhoAmI() (*params.UserWithoutPwd, error)
NOTE: this route is not implemented in the backend yet.
func (*NexusClient) VMAddAccess ¶
func (nc *NexusClient) VMAddAccess(vmID, vmName, email string, vmAccessCaps *params.VMAddAccess) error
func (*NexusClient) VMAttachFromCreds ¶
func (nc *NexusClient) VMAttachFromCreds(v vm.VMAttachCredentialsSerialized, fullscreen bool) error
func (*NexusClient) VMAttachFromID ¶
func (nc *NexusClient) VMAttachFromID(vmID string, fullscreen bool) error
func (*NexusClient) VMAttachFromPwd ¶
func (nc *NexusClient) VMAttachFromPwd(pwd string, fullscreen bool) error
func (*NexusClient) VMCreate ¶
func (nc *NexusClient) VMCreate(p params.VMCreate) (*vm.VMNetworkSerialized, error)
func (*NexusClient) VMDel ¶
func (nc *NexusClient) VMDel(vmID string) error
func (*NexusClient) VMDelAccess ¶
func (nc *NexusClient) VMDelAccess(vmID, vmName, email string) error
func (*NexusClient) VMEdit ¶
func (nc *NexusClient) VMEdit(vmID string, p params.VMEdit) (*vm.VMNetworkSerialized, error)
func (*NexusClient) VMExportDir ¶
func (nc *NexusClient) VMExportDir(vmName, vmID, dirToExport string) (string, error)
func (*NexusClient) VMImportArchive ¶
func (nc *NexusClient) VMImportArchive(vmID, vmDir, archiveFile string) error
func (*NexusClient) VMReboot ¶
func (nc *NexusClient) VMReboot(vmID string) error
func (*NexusClient) VMShutdown ¶
func (nc *NexusClient) VMShutdown(vmID string) error
func (*NexusClient) VMStart ¶
func (nc *NexusClient) VMStart(vmID string) error
func (*NexusClient) VMStartWithCreds ¶
func (nc *NexusClient) VMStartWithCreds(vmID string, p params.VMStartWithCreds) error
func (*NexusClient) VMStop ¶
func (nc *NexusClient) VMStop(vmID string) error
Source Files
¶
- client.go
- remote-viewer.go
- response.go
- template.go
- user.go
- version.go
- vm.go