managedstate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package managedstate persists JSON records through an explicitly selected SDK backend. Instances are event-loop owned. No disk or private-to-portable fallback

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortableBackend

type PortableBackend interface {
	Read(context.Context) (sdk.SettingsResult, error)
	Update(context.Context, map[string]any) (sdk.SettingsResult, error)
}

type State

type State struct {
	Dirty     bool
	Assurance string
	// contains filtered or unexported fields
}

func New

func New(mode, key string, portable PortableBackend, private PrivateBackend) (*State, error)

Create state with an explicit session, portable or private mode

func (*State) CheckPending

func (s *State) CheckPending() error

Check whether an uncertain commit still needs reconciliation

func (*State) Load

func (s *State) Load(ctx context.Context) (map[string]json.RawMessage, error)

Load state from the explicitly selected persistence backend

func (*State) MarkDirty

func (s *State) MarkDirty()

Mark state as changed without committing it

func (*State) Save

func (s *State) Save(ctx context.Context, value any) error

Save changed state using the selected persistence contract

Jump to

Keyboard shortcuts

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