db

package
v0.0.0-...-c683dee Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDoesNotExist = errors.New("key does not exist")

Functions

This section is empty.

Types

type IRepo

type IRepo interface {
	Set(key string, val []byte) error
	Get(key string) ([]byte, error)
	Del(key string) error
	GetAll() ([]string, error)
}

type Repo

type Repo struct {
	DB *bolt.DB
}

func Connect

func Connect() *Repo

func (*Repo) Del

func (r *Repo) Del(key string) error

func (*Repo) Get

func (r *Repo) Get(key string) ([]byte, error)

func (*Repo) GetAll

func (r *Repo) GetAll() ([]string, error)

func (*Repo) Set

func (r *Repo) Set(key string, val []byte) error

type Service

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

func NewService

func NewService(r IRepo) *Service

func (*Service) Del

func (s *Service) Del(key string) error

func (*Service) Get

func (s *Service) Get(key string, out interface{}) error

func (*Service) GetAll

func (s *Service) GetAll() ([]string, error)

func (*Service) Set

func (s *Service) Set(key string, val interface{}) error

Jump to

Keyboard shortcuts

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