db

package
v0.0.0-...-cd557cf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPath = "./data"
)

Functions

func ApplyFieldMask

func ApplyFieldMask(src proto.Message, dst proto.Message, fm *fieldmaskpb.FieldMask) error

func ApplyFieldMaskPaths

func ApplyFieldMaskPaths(src, dst proto.Message, path ...string) error

func FilterFieldMask

func FilterFieldMask(m proto.Message, fm *fieldmaskpb.FieldMask) error

func FilterFieldMaskPaths

func FilterFieldMaskPaths(m proto.Message, path ...string) error

func IsKeyOnlyFilter

func IsKeyOnlyFilter(f protodb.Filter, field string) bool

func MatchKey

func MatchKey(filter filters.FieldFilterer, value string) (bool, error)

func MatchPrefixOnly

func MatchPrefixOnly(f protodb.Filter) (string, bool)

func Open

func Open(ctx context.Context, opts ...Option) (protodb.DB, error)

Types

type Logger

type Logger = protodb.Logger

type Metrics

type Metrics struct {
	Get    OpMetrics
	Set    OpMetrics
	Delete OpMetrics
	Watch  OpMetrics
	Tx     TxMetrics
}

type MetricsEnd

type MetricsEnd interface {
	End()
}

type OpMetrics

type OpMetrics struct {
	OpsCounter    *prometheus.CounterVec
	ErrorsCounter *prometheus.CounterVec
	DurationHist  *prometheus.HistogramVec
	Inflight      *prometheus.GaugeVec
}

func (*OpMetrics) Start

func (m *OpMetrics) Start(lvs ...string) MetricsEnd

type Option

type Option func(o *options)

func WithApplyDefaults

func WithApplyDefaults(b bool) Option

func WithBadgerOptionsFunc

func WithBadgerOptionsFunc(fn func(opts badger.Options) badger.Options) Option

func WithIgnoreProtoRegisterErrors

func WithIgnoreProtoRegisterErrors() Option

func WithInMemory

func WithInMemory(b bool) Option

func WithLogger

func WithLogger(l Logger) Option

func WithOnClose

func WithOnClose(fn func()) Option

func WithPath

func WithPath(path string) Option

func WithProtoRegisterErrHandler

func WithProtoRegisterErrHandler(fn func(err error) error) Option

func WithReplication

func WithReplication(opts ...replication.Option) Option

type TxMetrics

type TxMetrics struct {
	OpMetrics
	SizeHist    prometheus.Histogram
	OpCountHist prometheus.Histogram
	Get         OpMetrics
	Set         OpMetrics
	Delete      OpMetrics
}

Jump to

Keyboard shortcuts

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