goapi

package module
v0.0.0-...-8dcdab8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 9 Imported by: 0

README

goapi

Vorteil Tools API Library for Golang

Documentation

Index

Constants

View Source
const (
	ProductionKernel = KernelType("prod")
	DebugKernel      = KernelType("debug")
)
View Source
const (
	DiskFormatRAW                 = DiskFormat("raw")
	DiskFormatGCP                 = DiskFormat("gcp")
	DiskFormatVMDK                = DiskFormat("vmdk")
	DiskFormatSparseVMDK          = DiskFormat("sparse-vmdk")
	DiskFormatStreamOptimizedVMDK = DiskFormat("steam-optimized-vmdk")
	DiskFormatOVA                 = DiskFormat("ova")
	DiskFormatVHD                 = DiskFormat("vhd")
	DiskFormatXVA                 = DiskFormat("xva")
)
View Source
const (
	BinaryInjection        = "binary"
	ConfigurationInjection = "configuration"
	IconInjection          = "icon"
	FileInjection          = "file"
	ArchiveInjection       = "archive"
	PackageInjection       = "package"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents an application within a bucket in a Vorteil repository.

func (*App) Authorization

func (a *App) Authorization() (*objects.Authorization, error)

Authorization returns a list of all Access Control Rules defined for the App, where the caller has adequate permissions to do so. Exactly one returned argument will be non-nil.

func (*App) Delete

func (a *App) Delete() error

Delete deletes the App from the repository.

func (*App) Germ

func (a *App) Germ() string

Germ returns a string that can be used to identify this app. This can be used in operations such as build, or run.

func (*App) Latest

func (a *App) Latest() (*Version, error)

Latest fetches the most recently uploaded version of an App. Exactly one returned argument will be non-nil.

func (*App) Name

func (a *App) Name() string

Name returns the protected 'name' field of the App.

func (*App) Version

func (a *App) Version(ref string) (*Version, error)

Version fetches a specific version of an App. The 'ref' argument can be either the hash or tag of the desired version. If the specified version could not be found, or the user has insufficient permissions, an error will be returned. Exactly one returned argument will be non-nil.

func (*App) VersionList

func (a *App) VersionList(curs *Cursor) (*VersionList, error)

VersionList fetches a list of all versions of the App. The 'curs' optional argument allows for pagination information to be passed to the request. Exactly one returned argument will be non-nil.

type AppList

type AppList struct {
	PageInfo objects.PageInfo
	Items    []AppListItem
}

AppList ..

type AppListItem

type AppListItem struct {
	Cursor string
	App    App
}

AppListItem ..

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

Bucket ..

func (*Bucket) App

func (b *Bucket) App(name string) (*App, error)

App ..

func (*Bucket) AppList

func (b *Bucket) AppList(curs *Cursor) (*AppList, error)

AppList ..

func (*Bucket) Authorization

func (b *Bucket) Authorization() (*objects.Authorization, error)

Authorization ..

func (*Bucket) Delete

func (b *Bucket) Delete() error

Delete the bucket. This action is irreversible.

func (*Bucket) Icon

func (b *Bucket) Icon() (*objects.Fragment, error)

Icon ..

func (*Bucket) Name

func (b *Bucket) Name() string

Name ..

type BucketList

type BucketList struct {
	PageInfo objects.PageInfo
	Items    []BucketListItem
}

BucketList ..

type BucketListItem

type BucketListItem struct {
	Cursor string
	Bucket Bucket
}

BucketListItem ..

type BuildArguments

type BuildArguments struct {
	Germ       string
	Injections []string
	DiskFormat DiskFormat
	KernelType KernelType
}

BuildArguments contain the fields used in a Build operation. Germ - a 'germ' string is an unambiguous pointer to a valid target for the

'build' operation. It could be the path to a package/project, or
an app/version within a repository [see (*App).Germ()]

Injections - a list of injection IDs, which the user can reference when

injecting various components to the build process (such as
configuration settings, files, etc.)

DiskFormat - the desired format of the resulting disk image. KernelType - "prod" or "debug" Repository - the repository that will perform the build operation (can be

left 'nil'; defaults to 'local').

type BuildManager

type BuildManager struct {
	// contains filtered or unexported fields
}

BuildManager provides access to build APIs.

func (*BuildManager) AnalyzeDisk

func (b *BuildManager) AnalyzeDisk(path string) (*FilesystemInfo, error)

AnalyzeDisk ..

func (*BuildManager) Build

func (b *BuildManager) Build(args *BuildArguments) (*BuildOperation, error)

Build a Vorteil disk image.

func (*BuildManager) WithEnvironment

func (m *BuildManager) WithEnvironment(r *Repository) *BuildManager

WithEnvironment ..

type BuildOperation

type BuildOperation struct {
	// contains filtered or unexported fields
}

BuildOperation ..

func (*BuildOperation) Inject

func (b *BuildOperation) Inject(key string, itype InjectionType, value io.Reader, headers http.Header) error

Inject ..

func (*BuildOperation) Start

func (b *BuildOperation) Start(w io.Writer) error

Start the build operation by providing an io.Writer to write the disk image to

func (*BuildOperation) WaitUntilFinished

func (b *BuildOperation) WaitUntilFinished() error

WaitUntilFinished ..

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides access to the Vorteil API by establishing a connection to the specified Vorteil environment.

func NewClient

func NewClient(cfg *ClientConfig) (*Client, error)

NewClient ..

func (*Client) Builds

func (c *Client) Builds() *BuildManager

BuildsManager ..

func (*Client) Machines

func (c *Client) Machines() *MachinesManager

MachinesManager ..

func (*Client) Repositories

func (c *Client) Repositories() *RepositoriesManager

RepositoriesManager ..

type ClientConfig

type ClientConfig struct {
	Address           string
	AuthenticationKey string
}

ClientConfig contains fields essential for the configuration of a new Client

type Cursor

type Cursor struct {
	First  int
	Last   int
	After  string
	Before string
}

Cursor ..

func (*Cursor) AddToRequest

func (c *Cursor) AddToRequest(req *graphql.Request)

AddToRequest ..

func (*Cursor) Strings

func (c *Cursor) Strings() (string, string)

Strings ..

type DiskFormat

type DiskFormat string

type FileInfo

type FileInfo struct {
	objects.FSInfo
}

FileInfo ..

type FilesystemInfo

type FilesystemInfo struct {
	Contents []FileInfo
}

FilesystemInfo ..

type InjectionType

type InjectionType string

InjectionType ..

type KernelType

type KernelType string

type MachinesManager

type MachinesManager struct {
	// contains filtered or unexported fields
}

MachinesManager provides access to 'Machine' APIs

func (*MachinesManager) Get

func (m *MachinesManager) Get(id string) (*VirtualMachine, error)

Get a virtual machine.

func (*MachinesManager) ListMachines

func (m *MachinesManager) ListMachines(cursor *Cursor) (*VirtualMachineList, error)

List all virtual machines.

func (*MachinesManager) Provision

Provision a virtual machine.

func (*MachinesManager) WithEnvironment

func (m *MachinesManager) WithEnvironment(r *Repository) *MachinesManager

WithEnvironment ..

type ProvisionArguments

type ProvisionArguments struct {
	Germ         string
	InstanceName string
	PoweredOn    bool
	Platform     string
	KernelType   KernelType
	Injections   []string
}

ProvisionArguments ..

type ProvisionOperation

type ProvisionOperation struct {
	// contains filtered or unexported fields
}

ProvisionOperation ..

func (*ProvisionOperation) Inject

func (p *ProvisionOperation) Inject(key string, itype InjectionType, value io.Reader, headers http.Header) error

Inject ..

func (*ProvisionOperation) WaitUntilFinished

func (p *ProvisionOperation) WaitUntilFinished() error

WaitUntilFinished ..

type PushArguments

type PushArguments struct {
	Germ              string
	DestinationBucket string
	DestinationApp    string
	RepositoryName    string
	Injections        []string
}

PushArguments ..

type PushOperation

type PushOperation struct {
	// contains filtered or unexported fields
}

PushOperation ..

func (*PushOperation) Inject

func (p *PushOperation) Inject(key string, itype InjectionType, value io.Reader, headers http.Header) error

Inject ..

func (*PushOperation) WaitUntilFinished

func (p *PushOperation) WaitUntilFinished() error

WaitUntilFinished ..

type RepositoriesManager

type RepositoriesManager struct {
	Local *Repository
	// contains filtered or unexported fields
}

RepositoriesManager provides access to the repositories APIs.

func (*RepositoriesManager) Connect

func (r *RepositoriesManager) Connect(name, addr, key string, skipInsecureCheck bool) error

Connect establishes a new repository connection.

func (*RepositoriesManager) Connections

func (r *RepositoriesManager) Connections() ([]Repository, error)

Connections lists all connected repositories.

func (*RepositoriesManager) Disconnect

func (r *RepositoriesManager) Disconnect(name string) error

Disconnect destroys the Repository object and unregisters it from the current Vorteil environment.

func (*RepositoriesManager) Get

func (r *RepositoriesManager) Get(name string) (*Repository, error)

Get a specific repository.

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository provides access to APIs specific to a single repository.

func (*Repository) Download

func (r *Repository) Download(bucket, app, version string, w io.Writer) error

Download an object (app/version) from the repository.

func (*Repository) GetBucket

func (r *Repository) GetBucket(name string) (*Bucket, error)

GetBucket ..

func (*Repository) ListBuckets

func (r *Repository) ListBuckets(cursor *Cursor) (*BucketList, error)

ListBuckets returns a list of buckets within the repository.

func (*Repository) NewBucket

func (r *Repository) NewBucket(name string) error

NewBucket creates a new bucket within the repository.

func (*Repository) Push

func (r *Repository) Push(args *PushArguments) (*PushOperation, error)

Push ..

func (*Repository) Upload

func (r *Repository) Upload() error

Upload an object (app/version) to the repository.

type Version

type Version struct {
	// contains filtered or unexported fields
}

Version ..

func (*Version) Delete

func (v *Version) Delete() error

Delete ..

func (*Version) File

func (v *Version) File() (*objects.PackageFragment, error)

File ..

func (*Version) Germ

func (v *Version) Germ() string

Germ returns a string that can be used to identify this app/version. This can be used in operations such as build, or run.

func (*Version) ID

func (v *Version) ID() string

ID ..

func (*Version) Icon

func (v *Version) Icon() (*objects.PackageFragment, error)

Icon ..

func (*Version) RemoveTag

func (v *Version) RemoveTag() error

RemoveTag ..

func (*Version) SetTag

func (v *Version) SetTag(tag string) error

SetTag ..

func (*Version) Tag

func (v *Version) Tag() (string, error)

Tag ..

func (*Version) UploadedTime

func (v *Version) UploadedTime() time.Time

UploadedTime ..

type VersionList

type VersionList struct {
	PageInfo objects.PageInfo
	Items    []VersionListItem
}

VersionList ..

type VersionListItem

type VersionListItem struct {
	Cursor  string
	Version Version
}

VersionListItem ..

type VirtualMachine

type VirtualMachine struct {
	// contains filtered or unexported fields
}

VirtualMachine provides access to APIs specific to a single virtual machine.

func (*VirtualMachine) Delete

func (v *VirtualMachine) Delete() error

Delete the virtual machine.

func (*VirtualMachine) ID

func (v *VirtualMachine) ID() string

ID ..

func (*VirtualMachine) Image

func (v *VirtualMachine) Image() error

Image downloads the virtual machine disk image.

func (*VirtualMachine) Name

func (v *VirtualMachine) Name() string

Name ..

func (*VirtualMachine) Pause

func (v *VirtualMachine) Pause() error

Pause the virtual machine.

func (*VirtualMachine) Start

func (v *VirtualMachine) Start() error

Start the virtual machine.

func (*VirtualMachine) Status

func (v *VirtualMachine) Status() (string, error)

Status returns the state of the virtual machine.

func (*VirtualMachine) Stop

func (v *VirtualMachine) Stop() error

Stop the virtual machine.

func (*VirtualMachine) Tail

func (v *VirtualMachine) Tail() error

Tail the virtual machine serial output.

type VirtualMachineList

type VirtualMachineList struct {
	PageInfo objects.PageInfo
	Items    []VirtualMachineListItem
}

VirtualMachineList ..

type VirtualMachineListItem

type VirtualMachineListItem struct {
	Cursor         string
	VirtualMachine VirtualMachine
}

VirtualMachineListItem ..

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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