Documentation ¶
Overview ¶
Attribs package offers up a flexible approach to attaching Attribs that then be used to avoid the brittle parameter problem.
Index ¶
- type Attributes
- func (a Attributes) Add(name string, value interface{}) Attributes
- func (a Attributes) Entries(entries ...string) Attributes
- func (a Attributes) Has(name string) bool
- func (a Attributes) Join(attributes Attributes) Attributes
- func (a Attributes) Remove(name string) Attributes
- func (a Attributes) Rename(oldName string, newName string) Attributes
- func (a Attributes) Replace(name string, value interface{}) Attributes
- func (a Attributes) ReplaceAttributes(incomingAttributes Attributes) Attributes
- func (a *Attributes) Value(name string) interface{}
- type ContainedAttributes
- func (ca *ContainedAttributes) AddAttribute(name string, value interface{})
- func (ca *ContainedAttributes) AllAttributes() Attributes
- func (ca *ContainedAttributes) Attribute(name string) interface{}
- func (ca *ContainedAttributes) AttributesNamed(entries ...string) Attributes
- func (ca *ContainedAttributes) HasAttribute(name string) bool
- func (ca *ContainedAttributes) JoiningAttributes(newAttributes Attributes)
- func (ca *ContainedAttributes) RemoveAttribute(name string)
- func (ca *ContainedAttributes) RenameAttribute(currentName string, newName string)
- func (ca *ContainedAttributes) ReplaceAttribute(name string, value interface{})
- type Interface
- type NameValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes []NameValuePair
Attributes is an array of name-value pairs.
func (Attributes) Add ¶
func (a Attributes) Add(name string, value interface{}) Attributes
func (Attributes) Entries ¶
func (a Attributes) Entries(entries ...string) Attributes
func (Attributes) Has ¶
func (a Attributes) Has(name string) bool
func (Attributes) Join ¶
func (a Attributes) Join(attributes Attributes) Attributes
func (Attributes) Remove ¶
func (a Attributes) Remove(name string) Attributes
func (Attributes) Rename ¶
func (a Attributes) Rename(oldName string, newName string) Attributes
func (Attributes) Replace ¶
func (a Attributes) Replace(name string, value interface{}) Attributes
func (Attributes) ReplaceAttributes ¶
func (a Attributes) ReplaceAttributes(incomingAttributes Attributes) Attributes
func (*Attributes) Value ¶
func (a *Attributes) Value(name string) interface{}
type ContainedAttributes ¶
type ContainedAttributes struct {
Attribs Attributes `json:"Attributes"`
}
func (*ContainedAttributes) AddAttribute ¶
func (ca *ContainedAttributes) AddAttribute(name string, value interface{})
func (*ContainedAttributes) AllAttributes ¶
func (ca *ContainedAttributes) AllAttributes() Attributes
func (*ContainedAttributes) Attribute ¶
func (ca *ContainedAttributes) Attribute(name string) interface{}
func (*ContainedAttributes) AttributesNamed ¶
func (ca *ContainedAttributes) AttributesNamed(entries ...string) Attributes
func (*ContainedAttributes) HasAttribute ¶
func (ca *ContainedAttributes) HasAttribute(name string) bool
func (*ContainedAttributes) JoiningAttributes ¶
func (ca *ContainedAttributes) JoiningAttributes(newAttributes Attributes)
func (*ContainedAttributes) RemoveAttribute ¶
func (ca *ContainedAttributes) RemoveAttribute(name string)
func (*ContainedAttributes) RenameAttribute ¶
func (ca *ContainedAttributes) RenameAttribute(currentName string, newName string)
func (*ContainedAttributes) ReplaceAttribute ¶
func (ca *ContainedAttributes) ReplaceAttribute(name string, value interface{})
type Interface ¶
type Interface interface { HasAttribute(name string) bool Attribute(name string) interface{} AllAttributes() Attributes AddAttribute(name string, value interface{}) RenameAttribute(currentName string, newName string) ReplaceAttribute(name string, value interface{}) RemoveAttribute(name string) JoiningAttributes(newAttributes Attributes) }
type NameValuePair ¶
type NameValuePair struct { Name string Value interface{} }
NameValuePair is a struct allowing some Name as text to be associated with a matching Value of any type.
Click to show internal directories.
Click to hide internal directories.