store

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

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Mu        sync.Mutex
	Monsters  map[int]models.Monster
	IdCounter int
}

func NewBackend

func NewBackend() *Store

NewBackend creates a new Backend

func (*Store) Create

func (b *Store) Create(key int, value models.Monster)

Create stores a value in the Backend

func (*Store) Delete

func (b *Store) Delete(key int) bool

func (*Store) Get

func (b *Store) Get(key int) (models.Monster, bool)

Read retrieves a value from the Backend

func (*Store) NextID

func (b *Store) NextID() int

func (*Store) Update

func (b *Store) Update(key int, monster models.Monster) bool

Jump to

Keyboard shortcuts

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