boltstore

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChallengeBucketID  = "challenges"
	PopularityBucketID = "popularity"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New(filename string) (*Store, error)

New opens the bbolt database at filename, creating the file and the required buckets if they do not already exist.

func (*Store) Close

func (s *Store) Close() error

Close releases the file lock and flushes the bbolt database.

func (*Store) DeleteChallenge

func (s *Store) DeleteChallenge(ctx context.Context, challengeID string) error

func (*Store) GetChallenge

func (s *Store) GetChallenge(ctx context.Context, challengeID string) (challenge.Model, error)

func (*Store) ListChallenges added in v0.3.0

func (s *Store) ListChallenges(ctx context.Context) (map[string]challenge.Model, error)

func (*Store) Popularity added in v0.3.0

func (s *Store) Popularity(ctx context.Context) (popularity.Snapshot, error)

func (*Store) PutChallenge

func (s *Store) PutChallenge(ctx context.Context, challengeID string, challenge challenge.Model) error

func (*Store) RegisterCompletion

func (s *Store) RegisterCompletion(ctx context.Context, challengeID string, completion challenge.Completion) error

func (*Store) RegisterVote added in v0.3.0

func (s *Store) RegisterVote(ctx context.Context, challengeID string, vote challenge.Vote) error

Jump to

Keyboard shortcuts

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