Documentation ¶
Index ¶
- type Client
- func (c Client) CreateAccessToken(state string) (oauth2.Token, error)
- func (c Client) CreateImage(backedUpAt time.Time, anon []byte) (models.Image, error)
- func (c Client) CreateInstance(image models.Image) (models.Instance, error)
- func (c Client) DestroyImage(image models.Image) error
- func (c Client) DestroyInstance(instance models.Instance) error
- func (c Client) FinaliseImage(imageID int) (models.Image, error)
- func (c Client) GetImage(id string) (models.Image, error)
- func (c Client) GetInstance(id string) (models.Instance, error)
- func (c Client) GetLatestImage() (models.Image, error)
- func (c Client) ListImages() ([]models.Image, error)
- func (c Client) ListInstances() ([]models.Instance, error)
- type DraupnirClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the client for a draupnir server
func (Client) CreateAccessToken ¶
CreateAccessToken creates an oauth access token
func (Client) CreateImage ¶
CreateImage creates a new image. This does not complete the process of preparing an image, subsequent upload and finalisation steps are required.
func (Client) CreateInstance ¶
CreateInstance creates a new instance
func (Client) DestroyImage ¶
DestroyImage destroys an image
func (Client) DestroyInstance ¶
DestroyInstance destroys an instance
func (Client) FinaliseImage ¶
FinaliseImage posts to images/id/done, causing draupnir to run the finalisation process to anonymise and prepare the image for usage.
func (Client) ListImages ¶
ListImages returns a list of all images
type DraupnirClient ¶
type DraupnirClient interface { GetImage(id string) (models.Image, error) GetInstance(id string) (models.Instance, error) ListImages() ([]models.Image, error) ListInstances() ([]models.Instance, error) CreateInstance(image models.Image) (models.Instance, error) DestroyInstance(instance models.Instance) error DestroyImage(image models.Image) error CreateAccessToken(string) (string, error) }
DraupnirClient defines the API that a draupnir client conforms to
Click to show internal directories.
Click to hide internal directories.