badgerdb

package
v0.0.0-...-1c8ecb5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *badger.DB)

Close closes the given badger database connection (provided so you don't have to import badger just to do this)

func Init

func Init(path string) (*badger.DB, error)

Init opens and returns a badger database connection don't forget to close it

Types

type ChallengeResultStore

type ChallengeResultStore struct {
	DB *badger.DB
}

ChallengeResultStore badger implementation (see domain)

func (ChallengeResultStore) Get

func (store ChallengeResultStore) Get(challengeResultID string) (domain.ChallengeResult, error)

Get a domain.ChallengeResult with the given challengeResultID from store's badger db

func (ChallengeResultStore) GetAll

func (store ChallengeResultStore) GetAll(challengeID string) ([]domain.ChallengeResult, error)

GetAll ChallengeResult for a given challengeID

func (ChallengeResultStore) Insert

Insert a domain.ChallengeResult into store's badger db

type ChallengeStore

type ChallengeStore struct {
	DB *badger.DB
}

ChallengeStore badger implementation (see domain)

func (ChallengeStore) Get

func (store ChallengeStore) Get(challengeID string) (domain.Challenge, error)

Get a domain.Challenge with the given challengeID from store's badger db

func (ChallengeStore) Insert

func (store ChallengeStore) Insert(c domain.Challenge) error

Insert a domain.Challenge into store's badger db

type MapStore

type MapStore struct {
	DB *badger.DB
}

MapStore badger implementation (see domain)

func (MapStore) Get

func (store MapStore) Get(mapID string) (domain.Map, error)

Get a domain.Map with the given mapID from store's badger db TODO: reduce code repetition in Get methods

func (MapStore) GetAll

func (store MapStore) GetAll() ([]domain.Map, error)

Gets []domain.Map of all maps to display on main page

func (MapStore) Insert

func (store MapStore) Insert(m domain.Map) error

Insert a domain.Map into store's badger db

Jump to

Keyboard shortcuts

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