internal

package
v0.0.0-...-bd77e7c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinPath

func JoinPath(path []Path) string

JoinPath joins path elements into a single path.

Types

type Path

type Path struct {
	Type PathType
	Elem string
}

func SplitPath

func SplitPath(key string) ([]Path, error)

SplitPath splits key into individual path elements.

type PathType

type PathType int
const (
	PathTypeKey   PathType = iota // PathTypeKey is map key like a/b in a[0][1].b
	PathTypeIndex                 // PathTypeIndex is array index like 0/1 in a[0][1].b
)

type Storage

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

Storage stores data in the properties format.

func NewStorage

func NewStorage() *Storage

NewStorage returns a new *Storage object.

func (*Storage) Copy

func (s *Storage) Copy() *Storage

Copy returns a new copy of the *Storage object.

func (*Storage) Data

func (s *Storage) Data() map[string]string

Data returns key-value pairs of the properties.

func (*Storage) Get

func (s *Storage) Get(key string) string

Get returns the key's value.

func (*Storage) Has

func (s *Storage) Has(key string) bool

Has returns whether the key exists.

func (*Storage) Keys

func (s *Storage) Keys() []string

Keys returns keys of the properties.

func (*Storage) Set

func (s *Storage) Set(key, val string) error

Set stores the key and its value.

func (*Storage) SubKeys

func (s *Storage) SubKeys(key string) ([]string, error)

SubKeys returns the sub keys of the key item.

Jump to

Keyboard shortcuts

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