variables

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 1 Imported by: 3

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, string)
	Get(string) string
	Has(string) bool
	Map() map[string]string
	Merge(Container) Container
	With(string, string) 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) string

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]string

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, value string)

Set stores value with given key

func (*Variables) With

func (vars *Variables) With(key, value string) 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