instancesdk

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlreadyExistsError

type AlreadyExistsError struct {
	Hash hash.Hash
}

AlreadyExistsError is an not found error.

func (*AlreadyExistsError) Error

func (e *AlreadyExistsError) Error() string

type Filter

type Filter struct {
	ServiceHash  hash.Hash
	InstanceHash hash.Hash
}

Filter to apply while listing instances.

type Instance

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

Instance exposes service instance APIs of MESG.

func New

func New(c container.Container, service servicesdk.Service, instanceDB database.InstanceDB, engineName, port string) *Instance

New creates a new Instance SDK with given options.

func (*Instance) Create

func (i *Instance) Create(serviceHash hash.Hash, env []string) (*instance.Instance, error)

Create creates a new service instance for service with id(sid/hash) and applies given env vars.

func (*Instance) Delete

func (i *Instance) Delete(hash hash.Hash, deleteData bool) error

Delete deletes an instance. if deleteData is enabled, any persistent data that belongs to the instance and to its dependencies will also be deleted.

func (*Instance) Get

func (i *Instance) Get(hash hash.Hash) (*instance.Instance, error)

Get retrieves instance by hash.

func (*Instance) List

func (i *Instance) List(f *Filter) ([]*instance.Instance, error)

List instances by f filter.

Jump to

Keyboard shortcuts

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