badger

package
v0.0.0-...-dd115e8 Latest Latest
Warning

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

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

Documentation

Overview

Package badger implements the storage interface using badger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badger

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

func New

func New(storageFile string, logger *zerolog.Logger) (*Badger, error)

func (*Badger) Close

func (b *Badger) Close() error

func (*Badger) Delete

func (b *Badger) Delete(ctx context.Context, key string) error

func (*Badger) DeleteAll

func (b *Badger) DeleteAll(ctx context.Context, prefix string) error

func (*Badger) DeleteIf

func (b *Badger) DeleteIf(ctx context.Context, key string, condition kvstore.Condition) error

func (*Badger) Exists

func (b *Badger) Exists(ctx context.Context, key string) (bool, error)

func (*Badger) Get

func (b *Badger) Get(ctx context.Context, key string) ([]byte, uint64, error)

func (*Badger) GetAll

func (b *Badger) GetAll(ctx context.Context, prefix string) (kvstore.Entries, error)

func (*Badger) GetAllKeys

func (b *Badger) GetAllKeys(ctx context.Context, prefix string) ([]string, error)

func (*Badger) GetBatch

func (b *Badger) GetBatch(ctx context.Context, keys ...string) (kvstore.Entries, error)

func (*Badger) GetFirst

func (b *Badger) GetFirst(ctx context.Context, prefix string) (*kvstore.Entry, error)

func (*Badger) GetLimit

func (b *Badger) GetLimit(ctx context.Context, prefix string, limit int64) (kvstore.Entries, error)

func (*Badger) Move

func (b *Badger) Move(ctx context.Context, oldKey string, newKey string) error

func (*Badger) MoveReplace

func (b *Badger) MoveReplace(ctx context.Context, oldKey string, newKey string, value []byte) error

func (*Badger) MoveReplaceIf

func (b *Badger) MoveReplaceIf(ctx context.Context, oldKey string, newKey string, value []byte, condition kvstore.Condition) error

func (*Badger) Set

func (b *Badger) Set(ctx context.Context, key string, value []byte) error

func (*Badger) SetDelete

func (b *Badger) SetDelete(ctx context.Context, key string, value []byte, delete string) error

func (*Badger) SetEmpty

func (b *Badger) SetEmpty(ctx context.Context, key string) error

func (*Badger) SetExpiry

func (b *Badger) SetExpiry(ctx context.Context, key string, value []byte, ttl time.Duration) error

func (*Badger) SetIf

func (b *Badger) SetIf(ctx context.Context, key string, value []byte, condition kvstore.Condition) error

func (*Badger) SetIfNotExist

func (b *Badger) SetIfNotExist(ctx context.Context, key string, value []byte) error

func (*Badger) SetIfNotExistExpiry

func (b *Badger) SetIfNotExistExpiry(ctx context.Context, key string, value []byte, ttl time.Duration) error

func (*Badger) Subscribe

func (b *Badger) Subscribe(ctx context.Context, prefix string, handler kvstore.SubscriptionHandler) error

type Logger

type Logger struct {
	// Logger inherits from the zerolog.Logger type
	*zerolog.Logger
}

HTTP is the logger object that can be embedded in the HTTP package

func (*Logger) Debugf

func (l *Logger) Debugf(s string, i ...interface{})

Debugf logs a Debug level message

func (*Logger) Errorf

func (l *Logger) Errorf(s string, i ...interface{})

Errorf logs an Error level message

func (*Logger) Infof

func (l *Logger) Infof(s string, i ...interface{})

Infof logs an Info level message

func (*Logger) Warningf

func (l *Logger) Warningf(s string, i ...interface{})

Warningf logs a Warn level message

type Options

type Options struct {
	StorageFile string
	LogName     string
}

Jump to

Keyboard shortcuts

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