data

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package data provides state data for boutique stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VarState

type VarState struct {
	// Name is the name of the published variable this represents.
	Name string
	// Type indicates the type of variable being stored.
	Type VarType
	// Int represents an int.
	Int int64
	// Float represents a float64.
	Float float64
	// Map represents a key/value lookup of expvar.Vars.
	Map map[string]expvar.Var
	// NoOp is incremented to indicate a Map sub value has changed.
	NoOp uint64
	// String represents a string
	String string
	// Func represents a function.
	Func func() interface{}
}

VarState holds state data for expvar's.

func (VarState) Value

func (v VarState) Value() interface{}

Value returns the internally held value.

func (VarState) ValueType

func (v VarState) ValueType() VarType

ValueType returns the ValueType held in VarState.

type VarType

type VarType int

VarType is used to indicate what type of variable is stored.

const (
	// UnknownType indicates that the VarType wasn't set.
	UnknownType VarType = 0
	// IntType indicates we are storing an Int.
	IntType VarType = 1
	// FloatType indicates we are storing a Float.
	FloatType VarType = 2
	// StringType indicates we are storing a String.
	StringType VarType = 3
	// MapType indicates we are storing a Map.
	MapType VarType = 4
	// FuncType indicates we are storing a func.
	FuncType VarType = 5
)

func (VarType) IsVarType

func (VarType) IsVarType() bool

IsVarType indicates this is a VarType.

func (VarType) String

func (v VarType) String() string

String implements fmt.Stringer.

func (VarType) SubString

func (v VarType) SubString() (string, error)

SubString returns the string needed to Subscribe to this variable's changes.

Jump to

Keyboard shortcuts

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