api

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCreateVMRequest

func MakeCreateVMRequest(clientName string) (*VM, *PrivateKey, error)

func MakeSignUpRequest

func MakeSignUpRequest(username string, email string, password string) error

Types

type CreateVMForUserAccount

type CreateVMForUserAccount struct {
	Vm   VM         `json:"vm"`
	Pkey PrivateKey `json:"pkey"`
}

type CreateVMForUserAccountResponseStruct

type CreateVMForUserAccountResponseStruct struct {
	CreateVMForUserAccount CreateVMForUserAccount `json:"createVMForUserAccount"`
}

type DataStore

type DataStore interface {
	InitTables() error
	PutVM(vm *VM) error
	GetHostnameForClientname(clientname string) (string, error)
	PutAuthTokens(tokenDetails TokenDetails) error
	GetAuthTokens() (accessToken string, refreshToken string, accessTokenExp string, refreshTokenExp string, err error)
	DeleteAuthTokens() error
}

func NewDB

func NewDB() DataStore

type MakeSignUpRequestStruct

type MakeSignUpRequestStruct struct {
	SignUpUserAccount SignUpUserAccount `json:"signUpUserAccount"`
}

type PrivateKey

type PrivateKey struct {
	KeyName        string `json:"keyName"`
	KeyMaterial    string `json:"keyMaterial"`
	KeyFingerprint string `json:"keyFingerprint"`
}

type SignUpUserAccount

type SignUpUserAccount struct {
	Token string `json:"token"`
}

type TokenDetails

type TokenDetails struct {
	AccessToken     string
	RefreshToken    string
	AccessTokenExp  time.Time
	RefreshTokenExp time.Time
}

type VM

type VM struct {
	ID         string `json:"ID"`
	OwnerID    string `json:"ownerID"`
	Name       string `json:"name"`
	InstanceID string `json:"instanceID"`
	PublicDNS  string `json:"publicDNS"`
	PublicIP   string `json:"publicIP"`
	KeyName    string `json:"keyName"`
	Zone       string `json:"zone"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL