soughtgame

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBStore

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

func NewDBStore

func NewDBStore(p *pgxpool.Pool) (*DBStore, error)

func (*DBStore) Delete

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

func (*DBStore) DeleteForSeekerConnID

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

DeleteForSeekerConnID deletes the game by connection ID

func (*DBStore) DeleteForUser

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

DeleteForUser deletes the game by seeker ID

func (*DBStore) Disconnect

func (s *DBStore) Disconnect()

func (*DBStore) ExistsForUser

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

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

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

Get gets the sought game with the given ID.

func (*DBStore) GetByReceiverConnID

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

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

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) New

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

func (*DBStore) UpdateForReceiver

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

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

func (*DBStore) UserMatchedBy

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