boltdb

package
v0.0.0-...-7fd672d Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "boltdb"

Variables

This section is empty.

Functions

func NewRegistrySet

func NewRegistrySet(c registry.Config) (*registry.Set, error)

func NoopHook

func NoopHook[T any, P registry.PIDable[T]](P) error

func Register

func Register()

Types

type AreaRegistry

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

func NewAreaRegistry

func NewAreaRegistry(db *bolt.DB, locationRegistry registry.LocationRegistry) *AreaRegistry

func (*AreaRegistry) AddCommodity

func (r *AreaRegistry) AddCommodity(areaID, commodityID string) error

func (*AreaRegistry) Count

func (r *AreaRegistry) Count() (int, error)

func (*AreaRegistry) Create

func (r *AreaRegistry) Create(m models.Area) (*models.Area, error)

func (*AreaRegistry) Delete

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

func (*AreaRegistry) DeleteCommodity

func (r *AreaRegistry) DeleteCommodity(areaID, commodityID string) error

func (*AreaRegistry) Get

func (r *AreaRegistry) Get(id string) (result *models.Area, err error)

func (*AreaRegistry) GetCommodities

func (r *AreaRegistry) GetCommodities(areaID string) ([]string, error)

func (*AreaRegistry) GetOneByName

func (r *AreaRegistry) GetOneByName(name string) (result *models.Area, err error)

func (*AreaRegistry) List

func (r *AreaRegistry) List() (results []*models.Area, err error)

func (*AreaRegistry) Update

func (r *AreaRegistry) Update(m models.Area) (result *models.Area, err error)

type CommodityRegistry

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

func NewCommodityRegistry

func NewCommodityRegistry(db *bolt.DB, areaRegistry registry.AreaRegistry) *CommodityRegistry

func (*CommodityRegistry) AddImage

func (r *CommodityRegistry) AddImage(commodityID, imageID string) error

func (*CommodityRegistry) AddInvoice

func (r *CommodityRegistry) AddInvoice(commodityID, invoiceID string) error

func (*CommodityRegistry) AddManual

func (r *CommodityRegistry) AddManual(commodityID, manualID string) error

func (*CommodityRegistry) Count

func (r *CommodityRegistry) Count() (int, error)

func (*CommodityRegistry) Create

func (*CommodityRegistry) Delete

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

func (*CommodityRegistry) DeleteImage

func (r *CommodityRegistry) DeleteImage(commodityID, imageID string) error

func (*CommodityRegistry) DeleteInvoice

func (r *CommodityRegistry) DeleteInvoice(commodityID, invoiceID string) error

func (*CommodityRegistry) DeleteManual

func (r *CommodityRegistry) DeleteManual(commodityID, manualID string) error

func (*CommodityRegistry) Get

func (*CommodityRegistry) GetImages

func (r *CommodityRegistry) GetImages(commodityID string) ([]string, error)

func (*CommodityRegistry) GetInvoices

func (r *CommodityRegistry) GetInvoices(commodityID string) ([]string, error)

func (*CommodityRegistry) GetManuals

func (r *CommodityRegistry) GetManuals(commodityID string) ([]string, error)

func (*CommodityRegistry) GetOneByName

func (r *CommodityRegistry) GetOneByName(name string) (result *models.Commodity, err error)

func (*CommodityRegistry) List

func (r *CommodityRegistry) List() ([]*models.Commodity, error)

func (*CommodityRegistry) Update

type Config

type Config registry.Config

type HookFn

type HookFn[T any, P registry.PIDable[T]] func(dbx.TransactionOrBucket, P) error

type ImageRegistry

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

func NewImageRegistry

func NewImageRegistry(db *bolt.DB, commodityRegistry registry.CommodityRegistry) *ImageRegistry

func (*ImageRegistry) Count

func (r *ImageRegistry) Count() (int, error)

func (*ImageRegistry) Create

func (r *ImageRegistry) Create(m models.Image) (*models.Image, error)

func (*ImageRegistry) Delete

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

func (*ImageRegistry) Get

func (r *ImageRegistry) Get(id string) (*models.Image, error)

func (*ImageRegistry) List

func (r *ImageRegistry) List() ([]*models.Image, error)

func (*ImageRegistry) Update

func (r *ImageRegistry) Update(m models.Image) (*models.Image, error)

type InvoiceRegistry

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

func NewInvoiceRegistry

func NewInvoiceRegistry(db *bolt.DB, commodityRegistry registry.CommodityRegistry) *InvoiceRegistry

func (*InvoiceRegistry) Count

func (r *InvoiceRegistry) Count() (int, error)

func (*InvoiceRegistry) Create

func (r *InvoiceRegistry) Create(m models.Invoice) (*models.Invoice, error)

func (*InvoiceRegistry) Delete

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

func (*InvoiceRegistry) Get

func (r *InvoiceRegistry) Get(id string) (*models.Invoice, error)

func (*InvoiceRegistry) List

func (r *InvoiceRegistry) List() ([]*models.Invoice, error)

func (*InvoiceRegistry) Update

func (r *InvoiceRegistry) Update(m models.Invoice) (*models.Invoice, error)

type LocationRegistry

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

func NewLocationRegistry

func NewLocationRegistry(db *bolt.DB) *LocationRegistry

func (*LocationRegistry) AddArea

func (r *LocationRegistry) AddArea(locationID, areaID string) error

func (*LocationRegistry) Count

func (r *LocationRegistry) Count() (int, error)

func (*LocationRegistry) Create

func (*LocationRegistry) Delete

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

func (*LocationRegistry) DeleteArea

func (r *LocationRegistry) DeleteArea(locationID, areaID string) error

func (*LocationRegistry) Get

func (r *LocationRegistry) Get(id string) (result *models.Location, err error)

func (*LocationRegistry) GetAreas

func (r *LocationRegistry) GetAreas(locationID string) ([]string, error)

func (*LocationRegistry) GetOneByName

func (r *LocationRegistry) GetOneByName(name string) (result *models.Location, err error)

func (*LocationRegistry) List

func (r *LocationRegistry) List() (results []*models.Location, err error)

func (*LocationRegistry) Update

func (r *LocationRegistry) Update(m models.Location) (result *models.Location, err error)

type ManualRegistry

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

func NewManualRegistry

func NewManualRegistry(db *bolt.DB, commodityRegistry registry.CommodityRegistry) *ManualRegistry

func (*ManualRegistry) Count

func (r *ManualRegistry) Count() (int, error)

func (*ManualRegistry) Create

func (r *ManualRegistry) Create(m models.Manual) (*models.Manual, error)

func (*ManualRegistry) Delete

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

func (*ManualRegistry) Get

func (r *ManualRegistry) Get(id string) (*models.Manual, error)

func (*ManualRegistry) List

func (r *ManualRegistry) List() ([]*models.Manual, error)

func (*ManualRegistry) Update

func (r *ManualRegistry) Update(m models.Manual) (*models.Manual, error)

type Registry

type Registry[T any, P registry.PIDable[T]] struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry[T any, P registry.PIDable[T]](
	db *bolt.DB,
	base *dbx.BaseRepository[T, P],
	entityName string,
	childrenBucketName string,
) *Registry[T, P]

func (*Registry[T, P]) AddChild

func (r *Registry[T, P]) AddChild(childEntityBucketName, entityID, childID string) error

func (*Registry[T, P]) Count

func (r *Registry[T, P]) Count() (int, error)

func (*Registry[T, P]) Create

func (r *Registry[T, P]) Create(m T, before, after HookFn[T, P]) (P, error)

func (*Registry[T, P]) Delete

func (r *Registry[T, P]) Delete(id string, before, after HookFn[T, P]) error

func (*Registry[T, P]) DeleteChild

func (r *Registry[T, P]) DeleteChild(childEntityBucketName, entityID, childID string) error

func (*Registry[T, P]) DeleteEmptyBuckets

func (r *Registry[T, P]) DeleteEmptyBuckets(tx dbx.TransactionOrBucket, entityID string, bucketNames ...string) error

func (*Registry[T, P]) Get

func (r *Registry[T, P]) Get(id string) (result P, err error)

func (*Registry[T, P]) GetBy

func (r *Registry[T, P]) GetBy(idx, value string) (result P, err error)

func (*Registry[T, P]) GetChildren

func (r *Registry[T, P]) GetChildren(childEntityBucketName, entityID string) ([]string, error)

func (*Registry[T, P]) List

func (r *Registry[T, P]) List() (results []P, err error)

func (*Registry[T, P]) Update

func (r *Registry[T, P]) Update(m T, before, after HookFn[T, P]) (result P, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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