variables

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: GPL-3.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Set(string, interface{})
	Get(string) interface{}
	Has(string) bool
	Map() map[string]interface{}
	Merge(Container) Container
	With(string, interface{}) Container
}

Container is an interface of variables container. Is is simple key-value structure.

func FromMap

func FromMap(values map[string]string) Container

FromMap creates new Variables instance from given map

type Variables

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

Variables is struct containing simple key-value string values

func NewVariables

func NewVariables() *Variables

NewVariables creates new Variables instance

func (*Variables) Get

func (vars *Variables) Get(key string) interface{}

Get returns value by given key

func (*Variables) Has

func (vars *Variables) Has(name string) bool

Has checks if value exists

func (*Variables) Map

func (vars *Variables) Map() map[string]interface{}

Map returns container in map[string]string form

func (*Variables) Merge

func (vars *Variables) Merge(src Container) Container

Merge merges two Containers into new one

func (*Variables) Set

func (vars *Variables) Set(key string, value interface{})

Set stores value with given key

func (*Variables) With

func (vars *Variables) With(key string, value interface{}) Container

With creates new container and sets key to given value

Jump to

Keyboard shortcuts

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