repository

package
v0.0.0-...-f4031c0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrKeyNotFound .
	ErrKeyNotFound = errors.New("key not found")
)

Functions

func Init

func Init(db DBType) (err error)

Init with specify DB type

Types

type DBType

type DBType uint8

DBType .

const (
	Unknown DBType = iota // unknown
	Redis                 // redis
	Badger                // badger
)

type IRepository

type IRepository interface {
	Get(key []byte) ([]byte, error)

	Update(key, value []byte) error

	Close()
}

IRepository .

func GetRepo

func GetRepo() IRepository

GetRepo .

func NewBadgerRepo

func NewBadgerRepo(dir string) (IRepository, error)

NewBadgerRepo .

func NewRedisRepo

func NewRedisRepo() (IRepository, error)

NewRedisRepo .

Jump to

Keyboard shortcuts

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