repo

package
v0.0.0-...-e9bd53e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TblUsers       = "users"
	TblUserAPIKeys = "user_api_keys"
)

Functions

This section is empty.

Types

type AuthRepo

type AuthRepo interface {
	SignIn(ctx context.Context, username, password string) (userApiKey *models.UserAPIKey, err error)
	CheckUserAPIKey(ctx context.Context, apiKey string) (user *models.User, err error)
	Read(ctx context.Context, userID string) (*models.User, error)
	UpsertUser(ctx context.Context, userID *string, input *models.User) (*models.User, error)
}

func NewAuthRepoSvc

func NewAuthRepoSvc(db *database.DB, log logger.Logger, catalog msgcat.MessageCatalog) AuthRepo

type AuthRepoSvc

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

func (*AuthRepoSvc) CheckUserAPIKey

func (svc *AuthRepoSvc) CheckUserAPIKey(ctx context.Context, apiKey string) (user *models.User, err error)

func (*AuthRepoSvc) Read

func (svc *AuthRepoSvc) Read(ctx context.Context, userID string) (*models.User, error)

func (*AuthRepoSvc) SignIn

func (svc *AuthRepoSvc) SignIn(ctx context.Context, username, password string) (userApiKey *models.UserAPIKey, err error)

func (*AuthRepoSvc) UpsertUser

func (svc *AuthRepoSvc) UpsertUser(ctx context.Context, userID *string, input *models.User) (*models.User, error)

type GameRepo

type GameRepo interface {
	UpsertGame(ctx context.Context, gameID *string, input *models.Game) (*models.Game, error)
	Read(ctx context.Context, gameID string) (game *models.Game, err error)
	List(ctx context.Context) (games []*models.Game, err error)
}

func NewGameRepoSvc

func NewGameRepoSvc(db *database.DB) GameRepo

type GameRepoSvc

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

func (*GameRepoSvc) List

func (svc *GameRepoSvc) List(ctx context.Context) (games []*models.Game, err error)

func (*GameRepoSvc) Read

func (svc *GameRepoSvc) Read(ctx context.Context, gameID string) (*models.Game, error)

func (*GameRepoSvc) UpsertGame

func (svc *GameRepoSvc) UpsertGame(ctx context.Context, gameID *string, input *models.Game) (*models.Game, error)

Jump to

Keyboard shortcuts

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