storage

package
v0.1.8-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Storage is a disk key value storage wrapper

func NewStorage

func NewStorage(path string, timeout time.Duration) (*Storage, error)

NewStorage creates new cursor file

func (*Storage) Close

func (s *Storage) Close() error

Close closes storage

func (*Storage) Delete

func (s *Storage) Delete(key string) error

Delete deletes row from storage by key

func (*Storage) Get

func (s *Storage) Get(key string) (string, error)

Get returns value by key from storage

func (*Storage) Keys

func (s *Storage) Keys() ([]string, error)

Keys returns all keys from storage or empty array with error

func (*Storage) Set

func (s *Storage) Set(key string, value string) error

Set updates value by key in storage

Jump to

Keyboard shortcuts

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