attrs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DOTAttrs

func DOTAttrs(a Attrs) []encoding.Attribute

DOTAttrs returns attrs as []enciding.Attribute

func New

func New() (*attrs, error)

New creates new attributes and returns it.

func NewCopyFrom

func NewCopyFrom(a Attrs) *attrs

NewCopyFrom copies attributes from a and returns it.

func NewFromMap added in v0.0.3

func NewFromMap(a map[string]string) (*attrs, error)

NewFromMap creates new attributes from a and returns it.

Types

type Attrs

type Attrs interface {
	// Keys returns all attribute keys.
	Keys() []string
	// Get returns the attribute value for the given key.
	Get(string) string
	// Set sets the value of the attribute for the given key.
	Set(string, string)
}

Attrs provide a simple key-value store for storing arbitrary entity attributes.

type DOT

type DOT interface {
	// Attributes returns attributes as a slice of encoding.Attribute.
	Attributes() []encoding.Attribute
}

DOT are Attrs which implement graph.DOTAttributes interface.

Jump to

Keyboard shortcuts

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