variables

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package variables is a thin wrapper over the sync.Map package

TODO: The sync.Map implementation may not really be necessary anymore since we denormalize the graph any/all vars and env vars will have their own address space so collision _will_ not occur. "¯\_(ツ)_/¯"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Variables

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

Variables is struct containing simple key-value string values

func FromMap

func FromMap(values map[string]string) *Variables

FromMap creates new Variables instance from given map

func NewVariables

func NewVariables() *Variables

NewVariables creates new Variables instance

func (*Variables) Get

func (vars *Variables) Get(key string) any

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

Map returns container in map[string]string form

func (*Variables) Merge

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

Merge merges into current container with the src Container src will overwrite the existing keys if exists returns a new instance of the merged *Variables

func (*Variables) Set

func (vars *Variables) Set(key string, value any)

Set stores value with given key

func (*Variables) With

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

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