engine

package
v0.0.0-...-a196992 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	DB *leveldb.DB

	Keylocks        map[string]struct{}
	Storages        []string
	ReplicaCount    int
	SubstorageCount int
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) Balance

func (e *Engine) Balance()

func (*Engine) Build

func (e *Engine) Build()

func (*Engine) DeleteHandler

func (e *Engine) DeleteHandler(key []byte) int

Delete removes a given key and returns a http response status.

func (*Engine) Get

func (e *Engine) Get(key []byte) entry.Entry

func (*Engine) LockKey

func (e *Engine) LockKey(key string) error

func (*Engine) Put

func (e *Engine) Put(key []byte, ent entry.Entry) error

func (*Engine) RemoveLock

func (e *Engine) RemoveLock(key string)

func (*Engine) ServeHTTP

func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Engine) WriteToStorage

func (e *Engine) WriteToStorage(key []byte, value io.Reader, clen int64) int

WriteToStorage handles writing the key-value pair into storage volumes. It returns the resulting http status code.

Jump to

Keyboard shortcuts

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