Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrIterate informs if iteration errors ErrIterate = errors.New("can't iterate over the colection documents") //ErrExtractDataToStruct informs if unable to extract firestore data to struct ErrExtractDataToStruct = errors.New("can't extract the data into a struct with DataTo") //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(TransferService) TransferService
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 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
type TransferService ¶
type TransferService interface {
TransferPlayer(ctx context.Context, playerTransfer string, TeamFrom string, TeamTo string) (string, error)
}
TransferService describe the Transfer service
func NewBasicService ¶
func NewBasicService(client *firestore.Client) TransferService
NewBasicService returns a naive, stateless implementation of PlayerOpsService.
func NewTransferService ¶
func NewTransferService(client *firestore.Client, logger log.Logger) TransferService
NewTransferService returns a basic TransferService with all of the expected middlewares wired in.
Click to show internal directories.
Click to hide internal directories.