soughtgame

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBStore added in v0.1.3

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

func NewDBStore added in v0.1.3

func NewDBStore(config *config.Config) (*DBStore, error)

func (*DBStore) Delete added in v0.1.3

func (s *DBStore) Delete(ctx context.Context, id string) error

func (*DBStore) DeleteForSeekerConnID added in v0.1.3

func (s *DBStore) DeleteForSeekerConnID(ctx context.Context, connID string) (*entity.SoughtGame, error)

DeleteForSeekerConnID deletes the game by connection ID

func (*DBStore) DeleteForUser added in v0.1.3

func (s *DBStore) DeleteForUser(ctx context.Context, userID string) (*entity.SoughtGame, error)

DeleteForUser deletes the game by seeker ID

func (*DBStore) ExistsForUser added in v0.1.3

func (s *DBStore) ExistsForUser(ctx context.Context, userID string) (bool, error)

ExistsForUser returns true if the user already has an outstanding seek request.

func (*DBStore) ExpireOld added in v0.1.3

func (s *DBStore) ExpireOld(ctx context.Context) error

ExpireOld expires old seek requests. Usually this shouldn't be necessary unless something weird happens.

func (*DBStore) Get added in v0.1.3

func (s *DBStore) Get(ctx context.Context, id string) (*entity.SoughtGame, error)

Get gets the sought game with the given ID.

func (*DBStore) GetByReceiverConnID added in v0.1.3

func (s *DBStore) GetByReceiverConnID(ctx context.Context, connID string) (*entity.SoughtGame, error)

GetByReceiverConnID gets the sought game with the given socket connection ID for the receiver.

func (*DBStore) GetBySeekerConnID added in v0.1.3

func (s *DBStore) GetBySeekerConnID(ctx context.Context, connID string) (*entity.SoughtGame, error)

GetBySeekerConnID gets the sought game with the given socket connection ID for the seeker.

func (*DBStore) ListOpenSeeks added in v0.1.3

func (s *DBStore) ListOpenSeeks(ctx context.Context, receiverID, tourneyID string) ([]*entity.SoughtGame, error)

ListOpenSeeks lists all open seek requests for receiverID, in tourneyID (optional)

func (*DBStore) Set added in v0.1.3

func (s *DBStore) Set(ctx context.Context, game *entity.SoughtGame) error

Set sets the sought-game in the database.

func (*DBStore) UpdateForReceiver added in v0.1.3

func (s *DBStore) UpdateForReceiver(ctx context.Context, receiverID string) (*entity.SoughtGame, error)

UpdateForReceiver updates the receiver's status when the receiver leaves

func (*DBStore) UpdateForReceiverConnID added in v0.1.3

func (s *DBStore) UpdateForReceiverConnID(ctx context.Context, connID string) (*entity.SoughtGame, error)

DeleteForConnID modifies the game by connection ID

func (*DBStore) UserMatchedBy added in v0.1.3

func (s *DBStore) UserMatchedBy(ctx context.Context, userID, matcher string) (bool, error)

UserMatchedBy returns true if there is an open seek request from matcher for user

Jump to

Keyboard shortcuts

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