kvhttp

package module
v0.0.0-...-2244e4f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Overview

Package kvhttp exports any visvasity/kv api compatible database over http API for remote access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(db kv.Database) http.Handler

Types

type DB

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

func New

func New(baseURL *url.URL, client *http.Client) *DB

func (*DB) Close

func (db *DB) Close() error

func (*DB) NewSnapshot

func (db *DB) NewSnapshot(ctx context.Context) (*Snap, error)

func (*DB) NewTransaction

func (db *DB) NewTransaction(ctx context.Context) (*Tx, error)

func (*DB) ServerURL

func (db *DB) ServerURL() url.URL

type Snap

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

func (*Snap) Ascend

func (snap *Snap) Ascend(ctx context.Context, begin, end string, errp *error) iter.Seq2[string, io.Reader]

func (*Snap) Descend

func (snap *Snap) Descend(ctx context.Context, begin, end string, errp *error) iter.Seq2[string, io.Reader]

func (*Snap) Discard

func (snap *Snap) Discard(ctx context.Context) error

func (*Snap) Get

func (snap *Snap) Get(ctx context.Context, key string) (io.Reader, error)

type Tx

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

func (*Tx) Ascend

func (tx *Tx) Ascend(ctx context.Context, begin, end string, errp *error) iter.Seq2[string, io.Reader]

func (*Tx) Commit

func (tx *Tx) Commit(ctx context.Context) error

func (*Tx) Delete

func (tx *Tx) Delete(ctx context.Context, key string) error

func (*Tx) Descend

func (tx *Tx) Descend(ctx context.Context, begin, end string, errp *error) iter.Seq2[string, io.Reader]

func (*Tx) Get

func (tx *Tx) Get(ctx context.Context, key string) (io.Reader, error)

func (*Tx) Rollback

func (tx *Tx) Rollback(ctx context.Context) error

func (*Tx) Set

func (tx *Tx) Set(ctx context.Context, key string, value io.Reader) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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