attributes

package
v0.0.0-...-c864ae1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: BSD-2-Clause, BSD-3-Clause, MIT Imports: 0 Imported by: 0

Documentation

Overview

Attribs package offers up a flexible approach to attaching Attribs that then be used to avoid the brittle parameter problem.

Index

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.

Jump to

Keyboard shortcuts

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