kv

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValueStore

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

In-memory key-value store

func NewKeyValueStore

func NewKeyValueStore() *KeyValueStore

func (*KeyValueStore) Clear

func (kv *KeyValueStore) Clear()

func (*KeyValueStore) Get

func (kv *KeyValueStore) Get(w http.ResponseWriter, r *http.Request)

Get value by key

func (*KeyValueStore) GetVal

func (kv *KeyValueStore) GetVal(key string) (val string, ok bool)

func (*KeyValueStore) Set

func (kv *KeyValueStore) Set(w http.ResponseWriter, r *http.Request)

Set value for a key

func (*KeyValueStore) SetVal

func (kv *KeyValueStore) SetVal(key, val string)

type Server

type Server struct {
	Listener net.Listener
	Port     int
}

func StartHttpServer

func StartHttpServer(kvStore *KeyValueStore) (error, *Server, func())

Jump to

Keyboard shortcuts

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