data

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 8 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	ServiceStartup(ctx context.Context, options application.ServiceOptions) error
	ServiceShutdown() error
	Get(pluginID, key string) (any, error)
	Set(pluginID, key string, value any) error
	Delete(pluginID, key string) error
	Keys(pluginID string) ([]string, error)
}

Controller provides a JSON key-value store for plugins to persist arbitrary data. Each key is stored as a separate JSON file under <stateRoot>/plugins/{pluginID}/data/.

func NewController

func NewController(logger logging.Logger, pluginDataFn func(string) (*appstate.ScopedRoot, error)) Controller

NewController creates a new data store controller. pluginDataFn returns a ScopedRoot for the given plugin's data directory.

type ServiceWrapper added in v0.4.0

type ServiceWrapper struct {
	Ctrl Controller
}

ServiceWrapper is an explicit delegation wrapper around data.Controller.

func (*ServiceWrapper) Delete added in v0.4.0

func (s *ServiceWrapper) Delete(pluginID, key string) error

func (*ServiceWrapper) Get added in v0.4.0

func (s *ServiceWrapper) Get(pluginID, key string) (any, error)

func (*ServiceWrapper) Keys added in v0.4.0

func (s *ServiceWrapper) Keys(pluginID string) ([]string, error)

func (*ServiceWrapper) ServiceShutdown added in v0.4.0

func (s *ServiceWrapper) ServiceShutdown() error

func (*ServiceWrapper) ServiceStartup added in v0.4.0

func (s *ServiceWrapper) ServiceStartup(ctx context.Context, options application.ServiceOptions) error

func (*ServiceWrapper) Set added in v0.4.0

func (s *ServiceWrapper) Set(pluginID, key string, value any) error

Jump to

Keyboard shortcuts

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