storage

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicStorage

type BasicStorage interface {
	// Save saves a piece of `Data`
	Save(key string, value io.Reader) (string, error)

	// Load loads a piece of `Data`
	Load(key string, index string) (io.ReadCloser, error)

	// Exist checks existence of a piece of `Data`
	Exist(key string, index string) (bool, error)

	// Delete deletes a piece of `Data`
	Delete(key string, index string) error

	// Update updates a piece of `Data`
	Update(key string, index string, value io.Reader) (string, error)
}

BasicStorage is an abstraction used to refer to any underlying system or device that XuperDB will store its data to. key is the identification of a piece of `Data`, and it's decided by end-users index is the index of stored data, and it's created by `BasicStorage` value contains content of a piece of `Data`

type Storage

type Storage interface {
	BasicStorage

	//LoadStr loads a piece of `Data`, and convert it to a string
	LoadStr(key string, index string) (string, error)
}

func NewStorage

func NewStorage(s BasicStorage) Storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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