state

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string) error

Delete removes a key from the state.

func Get

func Get(key string) (interface{}, bool, error)

Get retrieves a value from the state by key. Returns the value and true if found, nil and false otherwise.

func GetString

func GetString(key string) (string, error)

GetString is a convenience function to get a string value from state. Returns empty string if the key doesn't exist or the value is not a string.

func Save

func Save(state State) error

Save saves the state to the state file.

func Set

func Set(key string, value interface{}) error

Set sets a value in the state.

Types

type State

type State map[string]interface{}

State represents the local Grove state as a generic map of key-value pairs. This allows any Grove tool to store arbitrary state data.

func Load

func Load() (State, error)

Load loads the state from the state file. Returns an empty state if the file doesn't exist.

Jump to

Keyboard shortcuts

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