boltdb

package
v0.0.0-...-aea6139 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStore

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

BoltStore implements the stores.Storage interface

func New

func New(path string) (*BoltStore, error)

New returns a bolt store which implements the stores.Storage interface

func (*BoltStore) Close

func (b *BoltStore) Close() error

Close closes the bolt database

func (*BoltStore) CreateEntry

func (b *BoltStore) CreateEntry(entry shared.Entry, id, userIdentifier string) error

CreateEntry creates an entry by a given ID and returns an error

func (*BoltStore) DeleteEntry

func (b *BoltStore) DeleteEntry(id string) error

DeleteEntry deleted an entry by a given ID and returns an error

func (*BoltStore) GetEntryByID

func (b *BoltStore) GetEntryByID(id string) (*shared.Entry, error)

GetEntryByID returns a entry and an error by the shorted ID

func (*BoltStore) GetUserEntries

func (b *BoltStore) GetUserEntries(userIdentifier string) (map[string]shared.Entry, error)

GetUserEntries returns all user entries of an given user identifier

func (*BoltStore) GetVisitors

func (b *BoltStore) GetVisitors(id string) ([]shared.Visitor, error)

GetVisitors returns the visitors and an error of an entry

func (*BoltStore) IncreaseVisitCounter

func (b *BoltStore) IncreaseVisitCounter(id string) error

IncreaseVisitCounter increases the visit counter and sets the current time as the last visit ones

func (*BoltStore) RegisterVisitor

func (b *BoltStore) RegisterVisitor(id, visitID string, visitor shared.Visitor) error

RegisterVisitor saves the visitor in the database

Jump to

Keyboard shortcuts

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