fwdattribute

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fwdattribute provides types and mechanisms used to manage attributes for forwarding objects. An attribute is a named property identified by a human readable name and a string value. The name and value of an attribute is opaque to the forwarding api. An attribute may be associated with a forwarding object, forwarding context or the global context.

Index

Constants

This section is empty.

Variables

View Source
var Global = NewSet()

Global is a global set of attributes.

View Source
var List = make(map[ID]string)

List is a list of all possible attributes and the corresponding description.

Functions

func Register

func Register(id ID, help string)

Register registers an attribute as used. All attributes are expected to be registered during package initialization.

Types

type ID

type ID string

An ID is a human readable string that identifies an attribute.

type Set

type Set map[ID]string

A Set maps IDs to an opaque string. Note that a set is always passed by reference.

func NewSet

func NewSet() Set

NewSet creates a new set of attributes.

func (Set) Add

func (a Set) Add(key ID, value string)

Add adds (or updates) the value of an attribute.

func (Set) Delete

func (a Set) Delete(key ID)

Delete deletes an attribute.

func (Set) Get

func (a Set) Get(key ID) (string, bool)

Get returns the value of the specified key if it exists.

func (Set) Override

func (a Set) Override(b Set)

Override overrides attributes in the current set with the corresponding attributes in the specified set.

func (Set) String

func (a Set) String() string

String formats the attributes into a string.

Jump to

Keyboard shortcuts

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