Documentation
¶
Overview ¶
Package traits contains all the definitions and implementations of the core resource traits that are imported by all the resource implementations.
Index ¶
- type Base
- type Edgeable
- type GraphQueryable
- type Groupable
- func (obj *Groupable) AutoGroupMeta() *engine.AutoGroupMeta
- func (obj *Groupable) GetGroup() []engine.GroupableRes
- func (obj *Groupable) GroupCmp(res engine.GroupableRes) error
- func (obj *Groupable) GroupRes(res engine.GroupableRes) error
- func (obj *Groupable) IsGrouped() bool
- func (obj *Groupable) Parent() engine.GroupableRes
- func (obj *Groupable) SetAutoGroupMeta(meta *engine.AutoGroupMeta)
- func (obj *Groupable) SetGroup(grouped []engine.GroupableRes)
- func (obj *Groupable) SetGrouped(b bool)
- func (obj *Groupable) SetParent(res engine.GroupableRes)
- type Kinded
- type Meta
- type Named
- type Recvable
- type Refreshable
- type Reversible
- type Sendable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
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.
type Edgeable ¶
type Edgeable struct { // Xmeta is the stored meta. It should be called `meta` but it must be // public so that the `encoding/gob` package can encode it properly. Xmeta *engine.AutoEdgeMeta // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
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.
func (*Edgeable) SetAutoEdgeMeta ¶
func (obj *Edgeable) SetAutoEdgeMeta(meta *engine.AutoEdgeMeta)
SetAutoEdgeMeta lets you set all of the meta params for the automatic edges trait in a single call.
type GraphQueryable ¶
type GraphQueryable struct { // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
GraphQueryable contains a general implementation with some of the properties and methods needed to implement the graph query permission for resources.
func (*GraphQueryable) GraphQueryAllowed ¶
func (obj *GraphQueryable) GraphQueryAllowed(opts ...engine.GraphQueryableOption) error
GraphQueryAllowed returns nil if you're allowed to query the graph. This function accepts information about the requesting resource so we can determine the access with some form of fine-grained control.
type Groupable ¶
type Groupable struct { // Xmeta is the stored meta. It should be called `meta` but it must be // public so that the `encoding/gob` package can encode it properly. Xmeta *engine.AutoGroupMeta // 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. Callers of this method should probably also run SetParent.
func (*Groupable) Parent ¶
func (obj *Groupable) Parent() engine.GroupableRes
Parent returns the parent groupable resource that I am inside of.
func (*Groupable) SetAutoGroupMeta ¶
func (obj *Groupable) SetAutoGroupMeta(meta *engine.AutoGroupMeta)
SetAutoGroupMeta lets you set all of the meta params for the automatic grouping trait in a single call.
func (*Groupable) SetGroup ¶
func (obj *Groupable) SetGroup(grouped []engine.GroupableRes)
SetGroup sets the grouped resources into me. Callers of this method should probably also run SetParent.
func (*Groupable) SetGrouped ¶
SetGrouped sets a flag to tell if we are grouped.
func (*Groupable) SetParent ¶
func (obj *Groupable) SetParent(res engine.GroupableRes)
SetParent tells a particular grouped resource who their parent is.
type Kinded ¶
type Kinded struct { // Xkind is the stored kind. It should be called `kind` but it must be // public so that the `encoding/gob` package can encode it properly. Xkind string // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
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.
type Meta ¶
type Meta struct { // Xmeta is the stored meta. It should be called `meta` but it must be // public so that the `encoding/gob` package can encode it properly. Xmeta *engine.MetaParams // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
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.
func (*Meta) SetMetaParams ¶
func (obj *Meta) SetMetaParams(meta *engine.MetaParams)
SetMetaParams lets you set all of the meta params for the resource in a single call.
type Named ¶
type Named struct { // Xname is the stored name. It should be called `name` but it must be // public so that the `encoding/gob` package can encode it properly. Xname string // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
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.
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.
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 Reversible ¶
type Reversible struct { // Xmeta is the stored meta. It should be called `meta` but it must be // public so that the `encoding/gob` package can encode it properly. Xmeta *engine.ReversibleMeta // Bug5819 works around issue https://github.com/golang/go/issues/5819 Bug5819 interface{} // XXX: workaround }
Reversible contains a general implementation with most of the properties and methods needed to support reversing resources. It may be used as a starting point to avoid re-implementing the straightforward methods.
func (*Reversible) ReversibleMeta ¶
func (obj *Reversible) ReversibleMeta() *engine.ReversibleMeta
ReversibleMeta lets you get or set meta params for the reversing trait.
func (*Reversible) SetReversibleMeta ¶
func (obj *Reversible) SetReversibleMeta(meta *engine.ReversibleMeta)
SetReversibleMeta lets you set all of the meta params for the reversing trait in a single call.
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 ¶
Send is used to send a struct in CheckApply. This is typically wrapped in the resource API and consumed that way.