Documentation ¶
Overview ¶
Package attr defines types and helpers for accessing typed attributes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Getter ¶
Getter is an interface which is implemented by types which want to export typed values.
type Interface ¶
type Interface interface { // Name returns the name of the attribute. Name() string // IsEmpty returns true iff `x` is a representation of the empty value of this attribute. IsEmpty(x interface{}) bool // Value returns the value of this attribute in `g`. Value(g Getter) interface{} // Intersect returns the intersection of `x` and `y`, assumed to be the type of the // attribute. Intersect(x, y interface{}) interface{} }
Interface is a type which defines behaviour necessary to implement a typed attribute.
func Int ¶
Int constructs an implementation of Interface with the field name `f` to access an int attribute of an implementation of Getter.
Click to show internal directories.
Click to hide internal directories.