storage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRead                = errors.New("failed to read resource")
	ErrWrite               = errors.New("failed to write resource")
	ErrResourceNotReadable = errors.New("resource is not readable")
	ErrResourceNotWritable = errors.New("resource is not writable")
)

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Read() (any, error)
}

type Resource

type Resource interface {
	Start(name string, storage *Storage, events *event.Events)
	Stop()
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(memory map[string]Resource) *Storage

func (*Storage) Read

func (storage *Storage) Read(resource string) (any, error)

func (*Storage) Start

func (storage *Storage) Start(events *event.Events)

func (*Storage) Stop

func (storage *Storage) Stop()

func (*Storage) Write

func (storage *Storage) Write(resource string, value any) error

type Supported

type Supported interface {
	SupportedNumeric | bool
}

type SupportedNumeric added in v0.3.0

type SupportedNumeric interface {
	int32 | float32
}

type Writer

type Writer interface {
	Write(value any) error
}

Jump to

Keyboard shortcuts

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