domain

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 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 ItemManager

type ItemManager struct {
	Storage ItemStorage
}

ItemManager coordinates the persistent storage of items persented by the networking layer.

func (ItemManager) Create

func (m ItemManager) Create(ctx context.Context, create assets.ItemCreate) (*assets.Item, error)

Create creates a new item in persistent storage.

func (ItemManager) Get

func (m ItemManager) Get(ctx context.Context, id assets.ItemID) (*assets.Item, error)

Get returns a single item given the itemID.

func (ItemManager) List

func (m ItemManager) List(ctx context.Context, filter assets.ItemFilter) ([]*assets.Item, error)

List returns a slice of items based on the value of the filter.

func (ItemManager) Remove

func (m ItemManager) Remove(ctx context.Context, id assets.ItemID) error

Remove deletes the given item, based on the given itemID, from persistent storage.

func (ItemManager) Update

func (m ItemManager) Update(ctx context.Context, id assets.ItemID, update assets.ItemUpdate) (*assets.Item, error)

Update replaces the item in persistent storage.

type ItemStorage

ItemStorage defines the interface to manage the persistent storage of items.

type LinkManager

type LinkManager struct {
	Storage LinkStorage
}

LinkManager coordinates the persistent storage of links persented by the networking layer.

func (LinkManager) Create

func (m LinkManager) Create(ctx context.Context, create assets.LinkCreate) (*assets.Link, error)

Create creates a new link in persistent storage.

func (LinkManager) Get

func (m LinkManager) Get(ctx context.Context, id assets.LinkID) (*assets.Link, error)

Get returns a single link given the linkID.

func (LinkManager) List

func (m LinkManager) List(ctx context.Context, filter assets.LinkFilter) ([]*assets.Link, error)

List returns a slice of links based on the value of the filter.

func (LinkManager) Remove

func (m LinkManager) Remove(ctx context.Context, id assets.LinkID) error

Remove deletes the given link, based on the given linkID, from persistent storage.

func (LinkManager) Update

func (m LinkManager) Update(ctx context.Context, id assets.LinkID, update assets.LinkUpdate) (*assets.Link, error)

Update replaces the link in persistent storage.

type LinkStorage

LinkStorage defines the interface to manage the persistent storage of links.

type PlayerManager

type PlayerManager struct {
	Storage PlayerStorage
}

PlayerManager coordinates the persistent storage of plaeyers persented by the networking layer.

func (PlayerManager) Create

func (m PlayerManager) Create(ctx context.Context, create assets.PlayerCreate) (*assets.Player, error)

Create creates a new player in persistent storage.

func (PlayerManager) Get

Get returns a single player given the playerID.

func (PlayerManager) List

func (m PlayerManager) List(ctx context.Context, filter assets.PlayerFilter) ([]*assets.Player, error)

List returns a slice of players based on the value of the filter.

func (PlayerManager) Remove

func (m PlayerManager) Remove(ctx context.Context, id assets.PlayerID) error

Remove deletes the given player, based on the given playerID, from persistent storage.

func (PlayerManager) Update

Update replaces the player in persistent storage.

type PlayerStorage

PlayerStorage defines the interface to manage the persistent storage of items.

type RoomManager

type RoomManager struct {
	Storage RoomStorage
}

RoomManager coordinates the persistent storage of rooms persented by the networking layer.

func (RoomManager) Create

func (m RoomManager) Create(ctx context.Context, create assets.RoomCreate) (*assets.Room, error)

Create creates a new room in persistent storage.

func (RoomManager) Get

func (m RoomManager) Get(ctx context.Context, id assets.RoomID) (*assets.Room, error)

Get returns a single room given the roomID.

func (RoomManager) List

func (m RoomManager) List(ctx context.Context, filter assets.RoomFilter) ([]*assets.Room, error)

List returns a slice of rooms based on the value of the filter.

func (RoomManager) Remove

func (m RoomManager) Remove(ctx context.Context, id assets.RoomID) error

Remove deletes the given room, based on the given roomID, from persistent storage.

func (RoomManager) Update

func (m RoomManager) Update(ctx context.Context, id assets.RoomID, update assets.RoomUpdate) (*assets.Room, error)

Update replaces the room in persistent storage.

type RoomStorage

RoomStorage defines the interface to manage the persistent storage of items.

Jump to

Keyboard shortcuts

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