varex

package
v0.0.0-...-53986ba Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DottedFieldsToSliceEscaped

func DottedFieldsToSliceEscaped(s string) []string

func Format

func Format(v VarValue, kind VarKind) string

Format returns human-readable var value representation.

Types

type VarKind

type VarKind int

VarKind specifies special kinds of values, affects formatting.

const (
	KindDefault VarKind = iota
	KindMemory
	KindDuration
	KindString
)

type VarName

type VarName string

VarName represents variable name.

It has dot-separated format, like "memstats.Alloc", but can be used in different forms, hence it's own type.

It also can have optional "kind:" modifier, like "mem:" or "duration:"

func (VarName) Kind

func (v VarName) Kind() VarKind

Kind returns kind of variable, based on it's name modifiers ("mem:")

func (VarName) Long

func (v VarName) Long() string

Long returns long name, without kind: modifier.

func (VarName) Short

func (v VarName) Short() string

Short returns short name, which is typically is the last word in the long names.

func (VarName) ToSlice

func (v VarName) ToSlice() []string

ToSlice converts "dot-separated" notation into the "slice of strings".

"dot-separated" notation is a human-readable format, passed via args. "slice of strings" is used by Jason library.

Example: "memstats.Alloc" => []string{"memstats", "Alloc"} Example: "mem:memstats.Alloc" => []string{"memstats", "Alloc"}

type VarValue

type VarValue interface{}

VarValue represents arbitrary value for variable.

Jump to

Keyboard shortcuts

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