badger

package
v0.0.0-...-00b5140 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package badger represent a persistence storage system service, based on badger lib.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string
	File string
}

Config represent a persistence badger config.

type Persistence

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

Persistence represent a persistence adapter structure.

func New

func New(conf Config) (*Persistence, error)

New represent a new persistence adapter.

func (*Persistence) Close

func (p *Persistence) Close() error

Close the current DB.

func (*Persistence) DBExists

func (p *Persistence) DBExists() bool

DBExists test if a DB already exist.

func (*Persistence) GetCurrentHashSerialize

func (p *Persistence) GetCurrentHashSerialize(hash []byte) ([]byte, error)

GetCurrentHashSerialize the last hash serialize in the current DB.

func (*Persistence) GetLastHash

func (p *Persistence) GetLastHash() ([]byte, error)

GetLastHash the last hash in the current DB.

func (*Persistence) LastHash

func (p *Persistence) LastHash() []byte

LastHash get the last hash linked to the current DB.

func (*Persistence) SetLastHash

func (p *Persistence) SetLastHash(lastHash []byte)

SetLastHash update the last hash linked to the current DB.

func (*Persistence) Update

func (p *Persistence) Update(lastHash []byte, hashSerialize []byte) error

Update the last hash into the current DB.

Jump to

Keyboard shortcuts

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