simplehandler

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Unlicense Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	StorageHandler
}

Handler represents a simple handler

func New

func New(stg storage.Storage, logger *log.Logger) *Handler

New creates and returns a handler

func (*Handler) Get

func (h *Handler) Get(key []byte) ([]byte, error)

Get finds value by given key, and returns the value

type NSHandler

type NSHandler struct {
	Handler
	// contains filtered or unexported fields
}

NSHandler represents a simple namespaced handler

func NewNS

func NewNS(stg storage.NSStorage, logger *log.Logger) *NSHandler

NewNS create a handler with namespace storage

func (*NSHandler) GetNS

func (h *NSHandler) GetNS(ns, key []byte) ([]byte, error)

GetNS finds value in namespace by given key, and returns the value

type StorageHandler

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

StorageHandler represents a wrapper to storage.Storage

func (*StorageHandler) Load

func (h *StorageHandler) Load(file string) error

Load loads data into storage

func (*StorageHandler) Start

func (h *StorageHandler) Start(filein <-chan string, l *loader.Loader) <-chan bool

Start starts a handler goroutine

Jump to

Keyboard shortcuts

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