pogrebstore

package module
v0.0.0-...-e52e46c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 9 Imported by: 1

README

pogrebstore

GoDoc CI

Package pogrebstore implements the blob.Store interface using pogreb.

Documentation

Overview

Package pogrebstore implements the blob.KV interface using pogreb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Opener

func Opener(_ context.Context, addr string) (blob.KV, error)

Opener constructs a filestore from an address comprising a URL, for use with the store package. The host and path identify the database directory. The following optional query parameters are understood:

sync    : interval between automatic syncs (duration; default 10s)
compact : interval between automatic compactions (duration; default 1m)

Types

type KV

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

KV implements the blob.KV interface using a pogreb database.

func Open

func Open(path string, opts *Options) (*KV, error)

Open creates a KV by opening the pogreb database specified by path.

func (*KV) Close

func (s *KV) Close(_ context.Context) error

Close implements part of the blob.KV interface. It closes the underlying database instance and reports its result.

func (*KV) Delete

func (s *KV) Delete(_ context.Context, key string) error

Delete implements part of blob.KV.

func (*KV) Get

func (s *KV) Get(_ context.Context, key string) ([]byte, error)

Get implements part of blob.KV.

func (*KV) Len

func (s *KV) Len(ctx context.Context) (int64, error)

Len implements part of blob.KV.

func (*KV) List

func (s *KV) List(_ context.Context, start string, f func(string) error) error

List implements part of blob.KV. Note that the pogreb database does not iterate keys in a specified order, so a full scan is require, and all keys at or after start must be brought into memory and sorted.

func (*KV) Put

func (s *KV) Put(_ context.Context, opts blob.PutOptions) error

Put implements part of blob.KV.

type Options

type Options struct {
	// Options specific to the underlying database implementation.
	DBOptions *pogreb.Options
}

Options provides options for opening a pogreb database.

Jump to

Keyboard shortcuts

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