store

package
v0.0.0-...-6d10cd0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureStore

func ConfigureStore(ctx context.Context, name string, store Config)

ConfigureStore configures store with configuration data

func Load

func Load(ctx context.Context, name string, key string) (value []byte, err error)

Load returns data from specified store

func RegisterBuilder

func RegisterBuilder(ctx context.Context, name string, builder Builder)

RegisterBuilder registers store builder in the builder catalog

func RegisterStore

func RegisterStore(ctx context.Context, store Store)

RegisterStore registers store in the store catalog

func Save

func Save(ctx context.Context, name string, key string, value []byte) (err error)

Save puts data to specified store

func StopAll

func StopAll(ctx context.Context)

StopAll stores

Types

type Builder

type Builder func(ctx context.Context, name string, config map[string]interface{})

Builder describes a builder function

type Config

type Config struct {
	Type   string                 `yaml:"type"`
	Config map[string]interface{} `yaml:"config"`
}

Config configuration structure for store

type Store

type Store interface {
	//Name get name of the Store
	Name() string
	//Type get type of the Store
	Type() string
	//Save saves value with provided key
	Save(ctx context.Context, key string, value []byte) (err error)
	//Load loads value with provided key
	Load(ctx context.Context, key string) (value []byte, err error)
	//Stop stops store instance
	Stop(ctx context.Context)
}

Store Manopus storage interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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