Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶
func Clean()
Clean removes all cache from previous runs and ensures the directory exists
func Init ¶
func Init() bool
Init initialises variable persistence with the default directory (./cache/)
func InitWithDir ¶
InitWithDir initialises variable persistence with a given directory
Types ¶
type PersisentVar ¶
type PersisentVar[T any] struct { V T // The actual variable Name string // The name of the variable }
func Load ¶
func Load[T any](name string) *PersisentVar[T]
Load creates a persistent variable which is stored under the name. The name should be unique
func (*PersisentVar[T]) Save ¶
func (v *PersisentVar[T]) Save()
Save saves the state of the variable so that other cells can use it
Click to show internal directories.
Click to hide internal directories.