types

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2017 License: Apache-2.0 Imports: 4 Imported by: 236

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any json.RawMessage

Any is the raw configuration for the plugin

func AnyBytes

func AnyBytes(data []byte) *Any

AnyBytes returns an Any from the encoded message bytes

func AnyCopy added in v0.3.0

func AnyCopy(any *Any) *Any

AnyCopy makes a copy of the data in the given ptr.

func AnyString

func AnyString(s string) *Any

AnyString returns an Any from a string that represents the marshaled/encoded data

func AnyValue

func AnyValue(v interface{}) (*Any, error)

AnyValue returns an Any from a value by marshaling / encoding the input

func AnyValueMust

func AnyValueMust(v interface{}) *Any

AnyValueMust returns an Any from a value by marshaling / encoding the input. It panics if there's error.

func (*Any) Bytes

func (c *Any) Bytes() []byte

Bytes returns the encoded bytes

func (*Any) Decode

func (c *Any) Decode(typed interface{}) error

Decode decodes the any into the input typed struct

func (*Any) MarshalJSON

func (c *Any) MarshalJSON() ([]byte, error)

MarshalJSON implements the json Marshaler interface

func (*Any) String

func (c *Any) String() string

String returns the string representation.

func (*Any) UnmarshalJSON

func (c *Any) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json Unmarshaler interface

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

Link is a struct that represents an association between an infrakit managed resource and an entity in some other system. The mechanism of linkage is via labels or tags on both sides.

func NewLink() *Link

NewLink creates a link

func NewLinkFromMap added in v0.3.0

func NewLinkFromMap(m map[string]string) *Link

NewLinkFromMap constructs a link from data in the map

func (Link) Context added in v0.3.0

func (l Link) Context() string

Context returns the context of the link

func (*Link) Equal added in v0.3.0

func (l *Link) Equal(other Link) bool

Equal returns true if the links are the same - same value and context

func (*Link) InMap added in v0.3.0

func (l *Link) InMap(m map[string]string) bool

InMap returns true if the link is contained in the map

func (*Link) KVPairs added in v0.3.0

func (l *Link) KVPairs() []string

KVPairs returns the link representation as a slice of Key=Value pairs

func (Link) Label added in v0.3.0

func (l Link) Label() string

Label returns the label to look for the link

func (*Link) Map added in v0.3.0

func (l *Link) Map() map[string]string

Map returns a representation that is easily converted to JSON or YAML

func (Link) Valid added in v0.3.0

func (l Link) Valid() bool

Valid returns true if the link value is set

func (Link) Value added in v0.3.0

func (l Link) Value() string

Value returns the value of the link

func (*Link) WithContext added in v0.3.0

func (l *Link) WithContext(s string) *Link

WithContext sets a context for this link

func (*Link) WriteMap added in v0.3.0

func (l *Link) WriteMap(target map[string]string)

WriteMap writes to the target map. This will overwrite values of same key

Jump to

Keyboard shortcuts

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