Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrWrite informs if database write error occurs ErrWrite = errors.New("can't write the document") //ErrDelete informs if unable to delete the player ErrDelete = errors.New("can't delete the player from database") )
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware func(PlayerOpsService) PlayerOpsService
Middleware describes a service (as opposed to endpoint) middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
LoggingMiddleware takes a logger as a dependency and returns a ServiceMiddleware.
type Player ¶
type Player struct { Name string `firestore:"player"` Team string `firestore:"team"` Nationality string `firestore:"nationality"` Position string `firestore:"position"` Appearences int32 `firestore:"appearences"` Goals int32 `firestore:"goals"` Assists int32 `firestore:"assists"` Passes int32 `firestore:"passes"` Interceptions int32 `firestore:"Interceptions"` Tackles int32 `firestore:"Tackles"` Fouls int32 `firestore:"Fouls"` Price int32 `firestore:"Price"` }
Player struct holds player data
type PlayerOpsService ¶
type PlayerOpsService interface { CreatePlayer(ctx context.Context, playerCreate *Player) (string, error) DeletePlayer(ctx context.Context, playerDelete string, teamName string) (string, error) }
PlayerOpsService describe the PlayerOps service
func NewBasicService ¶
func NewBasicService(client *firestore.Client) PlayerOpsService
NewBasicService returns a naive, stateless implementation of PlayerOpsService.
func NewPlayerOpsService ¶
func NewPlayerOpsService(client *firestore.Client, logger log.Logger) PlayerOpsService
NewPlayerOpsService returns a basic PLayerOpsService with all of the expected middlewares wired in.
type Table ¶
type Table struct { TeamName string `firestore:"Name"` TeamPlayed int32 `firestore:"Played"` TeamWon int32 `firestore:"Won"` TeamDrawn int32 `firestore:"Drawn"` TeamLost int32 `firestore:"Lost"` TeamGF int32 `firestore:"GF"` TeamGA int32 `firestore:"GA"` TeamGD int32 `firestore:"GD"` TeamPoints int32 `firestore:"Points"` TeamCapital int32 `firestore:"Capital"` }
Table struct holds League table data
Click to show internal directories.
Click to hide internal directories.