items

package
v0.0.0-...-70bfa02 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID   uint32
	Name string
	Cost int32
}

type ItemRepoSqlite3

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

func NewItemRepoSqlite3

func NewItemRepoSqlite3(sqlite3DbFilePath string) *ItemRepoSqlite3

func (*ItemRepoSqlite3) Delete

func (r *ItemRepoSqlite3) Delete(itemID uint32) (Item, error)

func (*ItemRepoSqlite3) Get

func (r *ItemRepoSqlite3) Get(itemID uint32) (Item, error)

func (*ItemRepoSqlite3) List

func (r *ItemRepoSqlite3) List() ([]Item, error)

func (*ItemRepoSqlite3) Save

func (r *ItemRepoSqlite3) Save(item Item) (Item, error)

type ItemRepositoryInterface

type ItemRepositoryInterface interface {
	Get(id uint32) (Item, error)
	List() ([]Item, error)
	Save(item Item) (Item, error)
	Delete(id uint32) (Item, error)
}

type ItemStats

type ItemStats struct {
	ItemID   uint32
	Consumed uint32
}

func GetStatsForItem

func GetStatsForItem(itemStatsList []ItemStats, itemID uint32) (ItemStats, bool)

type ItemStatsRepoSqlite3

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

func NewItemStatsRepoSqlite3

func NewItemStatsRepoSqlite3(sqlite3DbFilePath string) *ItemStatsRepoSqlite3

func (*ItemStatsRepoSqlite3) CountConsumption

func (r *ItemStatsRepoSqlite3) CountConsumption(itemID uint32, consumed uint32) (ItemStats, error)

func (*ItemStatsRepoSqlite3) Get

func (r *ItemStatsRepoSqlite3) Get(itemID uint32) (ItemStats, error)

func (*ItemStatsRepoSqlite3) List

func (r *ItemStatsRepoSqlite3) List() ([]ItemStats, error)

type ItemStatsRepositoryInterface

type ItemStatsRepositoryInterface interface {
	Get(id uint32) (ItemStats, error)
	List() ([]ItemStats, error)
	CountConsumption(itemID uint32, consumed uint32) (ItemStats, error)
}

Jump to

Keyboard shortcuts

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