database

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChamberRepo

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

ChamberRepo represents a bbolt repository for managing Chambers.

func NewChamberRepo

func NewChamberRepo(db *bbolt.DB) (*ChamberRepo, error)

NewChamberRepo returns a new Chamber repository using the given bbolt database. It also creates the Chambers bucket if it is not yet created on disk.

func (*ChamberRepo) Delete

func (r *ChamberRepo) Delete(id string) error

Delete permanently removes a Chamber.

func (*ChamberRepo) Get

func (r *ChamberRepo) Get(id string) (*chamber.Chamber, error)

Get returns a Chamber by its ID.

func (*ChamberRepo) GetAll

func (r *ChamberRepo) GetAll() ([]*chamber.Chamber, error)

GetAll returns all Chambers.

func (*ChamberRepo) Save

func (r *ChamberRepo) Save(c *chamber.Chamber) error

Save creates or updates a Chamber.

type SettingsRepo

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

SettingsRepo represents a bbolt repository for managing Settings.

func NewSettingsRepo

func NewSettingsRepo(db *bbolt.DB) (*SettingsRepo, error)

NewSettingsRepo returns a new Settings repository using the given bbolt database. It also creates the Settings bucket if it is not yet created on disk.

func (*SettingsRepo) Get

func (r *SettingsRepo) Get() (*settings.Settings, error)

Get returns Settings.

func (*SettingsRepo) Save

func (r *SettingsRepo) Save(c *settings.Settings) error

Save creates or updates Settings.

Jump to

Keyboard shortcuts

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