traits

package
v0.0.0-...-f342e06 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Kinded
	Named
	Meta
}

Base contains all the minimum necessary structs to build a resource. It should be used as a starting point to avoid re-implementing the straightforward methods.

func (*Base) String

func (obj *Base) String() string

String returns a string representation of a resource.

type Edgeable

type Edgeable struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Edgeable contains a general implementation with some of the properties and methods needed to support autoedges on resources. It may be used as a start point to avoid re-implementing the straightforward methods.

func (*Edgeable) AutoEdgeMeta

func (obj *Edgeable) AutoEdgeMeta() *engine.AutoEdgeMeta

AutoEdgeMeta lets you get or set meta params for the automatic edges trait.

type Groupable

type Groupable struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Groupable contains a general implementation with most of the properties and methods needed to support autogrouping on resources. It may be used as a starting point to avoid re-implementing the straightforward methods.

func (*Groupable) AutoGroupMeta

func (obj *Groupable) AutoGroupMeta() *engine.AutoGroupMeta

AutoGroupMeta lets you get or set meta params for the automatic grouping trait.

func (*Groupable) GetGroup

func (obj *Groupable) GetGroup() []engine.GroupableRes

GetGroup returns everyone grouped inside me.

func (*Groupable) GroupCmp

func (obj *Groupable) GroupCmp(res engine.GroupableRes) error

GroupCmp compares two resources and decides if they're suitable for grouping. You'll probably want to override this method when implementing a resource... This base implementation assumes not, so override me!

func (*Groupable) GroupRes

func (obj *Groupable) GroupRes(res engine.GroupableRes) error

GroupRes groups resource argument (res) into self.

func (*Groupable) IsGrouped

func (obj *Groupable) IsGrouped() bool

IsGrouped determines if we are grouped.

func (*Groupable) SetGroup

func (obj *Groupable) SetGroup(grouped []engine.GroupableRes)

SetGroup sets the grouped resources into me.

func (*Groupable) SetGrouped

func (obj *Groupable) SetGrouped(b bool)

SetGrouped sets a flag to tell if we are grouped.

type Kinded

type Kinded struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Kinded contains a general implementation of the properties and methods needed to support the resource kind. It should be used as a starting point to avoid re-implementing the straightforward kind methods.

func (*Kinded) Kind

func (obj *Kinded) Kind() string

Kind returns the string representation for the kind this resource is.

func (*Kinded) SetKind

func (obj *Kinded) SetKind(kind string)

SetKind sets the kind string for this resource. It must only be set by the engine.

type Meta

type Meta struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Meta contains a general implementation of the properties and methods needed to support meta parameters. It should be used as a starting point to avoid re-implementing the straightforward meta methods.

func (*Meta) MetaParams

func (obj *Meta) MetaParams() *engine.MetaParams

MetaParams lets you get or set meta params for this trait.

type Named

type Named struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Named contains a general implementation of the properties and methods needed to support named resources. It should be used as a starting point to avoid re-implementing the straightforward name methods.

func (*Named) Name

func (obj *Named) Name() string

Name returns the unique name this resource has. It is only unique within its own kind.

func (*Named) SetName

func (obj *Named) SetName(name string)

SetName sets the unique name for this resource. It must only be unique within its own kind.

type Recvable

type Recvable struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Recvable contains a general implementation with some of the properties and methods needed to implement receiving from resources.

func (*Recvable) Recv

func (obj *Recvable) Recv() map[string]*engine.Send

Recv is used to get information that was passed in. This data can then be used to run the Send/Recv data transfer.

func (*Recvable) SetRecv

func (obj *Recvable) SetRecv(recv map[string]*engine.Send)

SetRecv is used to inject incoming values into the resource.

type Refreshable

type Refreshable struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Refreshable functions as flag storage for resources to signal that they support receiving refresh notifications, and what that value is. These are commonly used to send information that some aspect of the state is invalid due to an unlinked change. The canonical example is a svc resource that needs reloading after a configuration file changes.

func (*Refreshable) Refresh

func (obj *Refreshable) Refresh() bool

Refresh returns the refresh notification state.

func (*Refreshable) SetRefresh

func (obj *Refreshable) SetRefresh(b bool)

SetRefresh sets the refresh notification state.

type Sendable

type Sendable struct {

	// Bug5819 works around issue https://github.com/golang/go/issues/5819
	Bug5819 interface{} // XXX: workaround
	// contains filtered or unexported fields
}

Sendable contains a general implementation with some of the properties and methods needed to implement sending from resources. You'll need to implement the Sends method, and call the Send method in CheckApply via the Init API.

func (*Sendable) Send

func (obj *Sendable) Send(st interface{}) error

Send is used to send a struct in CheckApply. This is typically wrapped in the resource API and consumed that way.

func (*Sendable) Sends

func (obj *Sendable) Sends() interface{}

Sends returns a struct containing the defaults of the type we send. This needs to be implemented (overridden) by the struct with the Sendable trait to be able to send any values. The public struct field names are the keys used.

func (*Sendable) Sent

func (obj *Sendable) Sent() interface{}

Sent returns the struct of values that have been sent by this resource.

Jump to

Keyboard shortcuts

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