weblevel

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Port       = 33745
	PathSets   = "/sets"
	PathGet    = "/get"
	PathDel    = "/del"
	PathStat   = "/stat"
	PathSearch = "/search"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Del(key string) error
	Get(key string) (string, error)
	Set(key, val string)
	Sets(kv map[string]string)
	Stats()
	PrefixSearch(prefix string) map[string]string
}

type Options

type Options struct {
	Port     int
	DBPath   string
	Database *leveldb.DB
}

type ValKV

type ValKV struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

type WebClient

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

func NewClient

func NewClient(host string, port int) *WebClient

func (*WebClient) Del

func (w *WebClient) Del(key string) error

func (*WebClient) Get

func (w *WebClient) Get(key string) (string, error)

func (*WebClient) PrefixSearch

func (w *WebClient) PrefixSearch(prefix string) map[string]string

func (*WebClient) Set

func (w *WebClient) Set(key, val string)

func (*WebClient) Sets

func (w *WebClient) Sets(kv map[string]string)

func (*WebClient) Stats

func (w *WebClient) Stats()

type WebLevel

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

func NewServer

func NewServer(opt *Options) (*WebLevel, error)

func (*WebLevel) Bootstrap

func (w *WebLevel) Bootstrap()

Jump to

Keyboard shortcuts

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