sql

package
v0.0.0-...-3e81ab4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: CC0-1.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 MatchStorage

type MatchStorage interface {
	SaveMatch(ctx context.Context, match model.Match) error
	GetMatches(ctx context.Context, sessionId uint16, userId string, limit uint8, offset uint16) ([]*model.Match, error)
}

type SessionStorage

type SessionStorage interface {
	CreateSession(ctx context.Context, userId string) error
	GetSessions(ctx context.Context, userId string, limit uint8, offset uint16) ([]*model.Session, error)
	UpdateLatestSession(ctx context.Context, userId string) error
}

type Storage

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

func NewStorage

func NewStorage() (*Storage, error)

func (*Storage) CreateSession

func (s *Storage) CreateSession(ctx context.Context, userId string) (*model.Session, error)

func (*Storage) GetLatestSession

func (s *Storage) GetLatestSession(ctx context.Context, userId string) (*model.Session, error)

func (*Storage) GetMatches

func (s *Storage) GetMatches(ctx context.Context, sessionId uint16, userId string, limit uint8, offset uint16) ([]*model.Match, error)

func (*Storage) GetSessions

func (s *Storage) GetSessions(ctx context.Context, userId string, limit uint8, offset uint16) ([]*model.Session, error)

func (*Storage) GetUserByCode

func (s *Storage) GetUserByCode(ctx context.Context, code string) (*model.User, error)

func (*Storage) GetUsers

func (s *Storage) GetUsers(ctx context.Context) ([]*model.User, error)

func (*Storage) RemoveUser

func (s *Storage) RemoveUser(ctx context.Context, code string) error

func (*Storage) SaveMatch

func (s *Storage) SaveMatch(ctx context.Context, match model.Match) error

func (*Storage) SaveUser

func (s *Storage) SaveUser(ctx context.Context, displayName, code string) error

func (*Storage) UpdateSession

func (s *Storage) UpdateSession(ctx context.Context, sesh *model.Session, match model.Match, sessionId uint16) error

type UserStorage

type UserStorage interface {
	GetUserByCode(ctx context.Context, code string) (*model.User, error)
	GetUsers(ctx context.Context) ([]*model.User, error)
	SaveUser(ctx context.Context, displayName, code string) error
	RemoveUser(ctx context.Context, code string) error
}

Jump to

Keyboard shortcuts

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