content

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerType   = ObjectType("instance")
	ServiceType     = ObjectType("service")
	StackType       = ObjectType("stack")
	NetworkType     = ObjectType("network")
	HostType        = ObjectType("host")
	EnvironmentType = ObjectType("environment")
)
View Source
const (
	V1 = "2015-07-25"
	V2 = "2015-12-19"
	V3 = "2016-07-29"
)

Variables

View Source
var VersionMap = map[string]interface{}{}

Functions

func GetEnvironment

func GetEnvironment(store Store, version, clientIP string) (interface{}, bool)

func GetValue

func GetValue(obj interface{}, key string) (interface{}, bool)

Types

type Client

type Client struct {
	IP      string
	Version string
}

type IDResolution

type IDResolution interface {
	IDtoUUID(objectType ObjectType, id string) string
}

type Object

type Object interface {
	Get(key string) (interface{}, bool)
	Map() (map[string]interface{}, error)
	Name() string
}

type ObjectFactory

type ObjectFactory func(obj interface{}, client Client, store Store) Object

type ObjectType

type ObjectType string

type Store

type Store interface {
	IDResolution

	// Return types are all Object because the generic object walker for the API
	// does not deal with concrete types such as []ContainerWrapper, EnvironmentWrapper
	Environment(client Client) Object

	ByEnvironment(objectType ObjectType, client Client, environmentUUID string) []Object
	ByStack(objectType ObjectType, client Client, stackUUID string) []Object

	Object(uuid string, client Client) Object

	ServiceByID(id string) *client.ServiceInfo
	StackByID(id string) *client.StackInfo
	NetworkByID(id string) *client.NetworkInfo
	HostByID(id string) *client.HostInfo
	ContainerByID(id string) *client.InstanceInfo
	EnvironmentByUUID(environmentUUID string) *client.EnvironmentInfo

	ServiceByName(environmentUUID, stackName, name string) *client.ServiceInfo
	ContainerByName(environmentUUID, stackName, name string) *client.InstanceInfo

	// Self
	SelfContainer(client Client) *client.InstanceInfo
	SelfHost(client Client) Object

	Reload(all map[string]interface{})

	Add(val map[string]interface{})
	Remove(val map[string]interface{})

	Version() string

	WaitChanged()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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