svp

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: 3 Imported by: 0

Documentation

Overview

Package svp - StringValuePair - named constants

Note: Being immutable implies concurrency safetey.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeepInfoFriendly

type DeepInfoFriendly interface {
	DeepValueTypeName() string       // the type's name within its package
	DeepValueTypePkgPath() string    // the import path that uniquely identifies the package
	DeepValueTypeString() string     // may use shortened package names (e.g., base64 instead of "encoding/base64")
	DeepValueTypeKind() string       //
	DeepValueTypeIsComparable() bool //
	DeepValueTypeIsVariadic() bool   // (false, if Kind != Func)
}

DeepInfoFriendly interface - exported for go doc

I love to be informative - and even give metadata about my innermost content

use DeepValueTypeName to get the name of the type of my innermost content
use DeepValueTypePkgName to get the package name of the type of my innermost content
use DeepValueTypeString to get a 'nick-name' of the type of my innermost content
use DeepValueTypeKind to get the Kind of the type of my innermost content ( int, struct, func, ...)
use DeepValueTypeIsComparable ...
use DeepValueTypeIsVariadic (only useful, if my DeepValueTypeKind is a function)

Note: I use the nvp.Leaf in order to go deep down to my innermost content

Thus: Use me if I have the recursive 'onion-skins' nature - my-kind as content of my-kind ... as my content.

type Friendly

type Friendly interface {
	UserFriendly     // use.go
	InfoFriendly     // valuetype.go
	DeepInfoFriendly // leaftype.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, stuff)

type InfoFriendly

type InfoFriendly interface {
	ValueTypeName() string       // the type's name within its package
	ValueTypePkgPath() string    // the import path that uniquely identifies the package
	ValueTypeString() string     // may use shortened package names (e.g., base64 instead of "encoding/base64")
	ValueTypeKind() string       //
	ValueTypeIsComparable() bool //
	ValueTypeIsVariadic() bool   // (false, if Kind != Func)
}

InfoFriendly interface - exported for go doc

I love to be informative - and even give metadata about my content

use ValueTypeName to get the name of the type of my content
use ValueTypePkgName to get the package name of the type of my content
use ValueTypeString to get a 'nick-name' of the type of my content
use ValueTypeKind to get the Kind of the type of my content ( int, struct, func, ...)
use ValueTypeIsComparable ...
use ValueTypeIsVariadic (only useful, if my ValueTypeKind is a function)

Note: I use the "reflect" package to obtain metadata about my content - as You may have guessed ;-)

type StringValuePair

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

StringValuePair - aka svp - named constants

func New

func New(key string, val interface{}) *StringValuePair

New returns a new StringValuePair, named key, containing string val

func (*StringValuePair) DeepValueTypeIsComparable

func (p *StringValuePair) DeepValueTypeIsComparable() bool

DeepValueTypeIsComparable returns the IsComparable of the Type my innermost content

func (*StringValuePair) DeepValueTypeIsVariadic

func (p *StringValuePair) DeepValueTypeIsVariadic() bool

DeepValueTypeIsVariadic returns the IsVariadic of the Type my innermost content

func (*StringValuePair) DeepValueTypeKind

func (p *StringValuePair) DeepValueTypeKind() string

DeepValueTypeKind returns the Kind of the Type my innermost content

func (*StringValuePair) DeepValueTypeName

func (p *StringValuePair) DeepValueTypeName() string

DeepValueTypeName returns the Name of the Type my innermost content

func (*StringValuePair) DeepValueTypePkgPath

func (p *StringValuePair) DeepValueTypePkgPath() string

DeepValueTypePkgPath returns the PkgPath of the Type my innermost content

func (*StringValuePair) DeepValueTypeString

func (p *StringValuePair) DeepValueTypeString() string

DeepValueTypeString returns the String of the Type my innermost content

func (*StringValuePair) GetV

func (p *StringValuePair) GetV() interface{}

GetV returns my Value, my content - so to say

func (*StringValuePair) K

func (p *StringValuePair) K() string

K returns my Key string, my name - so to say

func (*StringValuePair) String

func (p *StringValuePair) String() string

String implements `fmt.Stringer`

func (*StringValuePair) V

func (p *StringValuePair) V() string

V returns my Value as string

func (*StringValuePair) ValueTypeIsComparable

func (p *StringValuePair) ValueTypeIsComparable() bool

ValueTypeIsComparable returns the IsComparable of the Type of Value

func (*StringValuePair) ValueTypeIsVariadic

func (p *StringValuePair) ValueTypeIsVariadic() bool

ValueTypeIsVariadic returns the IsVariadic of the Type of Value

func (*StringValuePair) ValueTypeKind

func (p *StringValuePair) ValueTypeKind() string

ValueTypeKind returns the Kind of the Type of Value

func (*StringValuePair) ValueTypeName

func (p *StringValuePair) ValueTypeName() string

ValueTypeName returns the Name of the Type of Value

func (*StringValuePair) ValueTypePkgPath

func (p *StringValuePair) ValueTypePkgPath() string

ValueTypePkgPath returns the PkgPath of the Type of Value

func (*StringValuePair) ValueTypeString

func (p *StringValuePair) ValueTypeString() string

ValueTypeString returns the String of the Type of Value

type UserFriendly

type UserFriendly interface {
	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 K (or String) to get my name
use V to get my (named) stuff

use me, as You please :-)

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

Jump to

Keyboard shortcuts

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