tag

package
v0.0.0-...-4b9bf86 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 2 Imported by: 11

Documentation

Overview

Package tag provides a StringValuePair - a named value

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Friendly

type Friendly interface {
	UserFriendly // use.go
}

Friendly - interface exposed for go doc only

I love to be friendly - thus: I give You a simple API!

Create me with New(name) or Tag(name, stuff)

type TagAny

type TagAny struct {
	// contains filtered or unexported fields
}

TagAny is a concurrency safe string-named any-value (string-any pair)

func New

func New(tag string) *TagAny

New returns a new (empty) Tag

func Tag

func Tag(tag string, val interface{}) *TagAny

Tag returns a new Tag, initially set to val

func (*TagAny) GetV

func (d *TagAny) GetV() interface{}

GetV returns my AnyValue/Payload

func (*TagAny) K

func (d *TagAny) K() string

K returns the tag string (= Key)

func (*TagAny) Lock

func (*TagAny) Lock()

Lock is a no-op used by -copylocks checker from `go vet`.

func (*TagAny) String

func (d *TagAny) String() string

String implements `fmt.Stringer`

func (*TagAny) Tag

func (d *TagAny) Tag(val interface{})

Tag attaches me to my AnyValue/Payload

func (*TagAny) V

func (d *TagAny) V() string

V returns my AnyValue/Payload as string

type UserFriendly

type UserFriendly interface {
	Tag(val interface{}) // Set/replace AnyValue/Payload
	String() string      // implement `fmt.Stringer`
	K() string           // returns my Key as string (shortcut for String())
	V() string           // returns my Value as string (via ats.GetString)
	GetV() interface{}   // returns my Value as is
}

UserFriendly - interface exposed for go doc only

I love to be easy - easy to use:

use me to Tag stuff,
use K (or String) to get my name
use V to get the name of my stuff
use GetV to get my stuff
use me, as You please :-)

Hint: I behave like a named variable - just with other names

Thus: You may like to use me, where 'normal' methodnames are used otherwise ;-)

Directories

Path Synopsis
Package tag extends "container/.../tag" with the pathfriendly functions from "do/nvp"
Package tag extends "container/.../tag" with the pathfriendly functions from "do/nvp"

Jump to

Keyboard shortcuts

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