types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RawMessage

func RawMessage(r *types.Any) (raw json.RawMessage)

RawMessage converts a pointer to a raw message to a copy of the value. If the pointer is nil, it returns an empty raw message. This is useful for structs where fields are json.RawMessage pointers for bi-directional marshal and unmarshal (value receivers will encode base64 instead of raw json when marshaled), so bi-directional structs should use pointer fields.

func RawMessagePtr added in v0.2.0

func RawMessagePtr(r *types.Any) *json.RawMessage

RawMessagePtr makes a copy of the Any and make it available as a pointer to a JSON raw message

func UnparseProperties

func UnparseProperties(id string, props Spec) (group.Spec, error)

UnparseProperties composes group.spec from id and props

Types

type AllocationMethod

type AllocationMethod struct {
	Size       uint
	LogicalIDs []instance.LogicalID
}

AllocationMethod defines the type of allocation and supervision needed by a flavor's Group.

type FlavorPlugin

type FlavorPlugin struct {
	Plugin     plugin.Name
	Properties *types.Any // this will be the Spec of the plugin
}

FlavorPlugin describes the flavor configuration

type InstancePlugin

type InstancePlugin struct {
	Plugin     plugin.Name
	Properties *types.Any // this will be the Spec of the plugin
}

InstancePlugin is the structure that describes an instance plugin.

type Spec

type Spec struct {
	Instance   InstancePlugin
	Flavor     FlavorPlugin
	Allocation AllocationMethod
}

Spec is the configuration schema for the plugin, provided in group.Spec.Properties

func MustParse

func MustParse(s Spec, e error) Spec

MustParse can be wrapped over ParseProperties to panic if parsing fails.

func ParseProperties

func ParseProperties(config group.Spec) (Spec, error)

ParseProperties parses the group plugin properties JSON document in a group configuration.

func (Spec) InstanceHash

func (c Spec) InstanceHash() string

InstanceHash computes a stable hash of the document in InstancePluginProperties.

Jump to

Keyboard shortcuts

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