Documentation ¶
Index ¶
- type AuthHandler
- type DatabaseAuthService
- type DatabaseRosterService
- type IDGeneratorFunc
- type RosterHandler
- func (h *RosterHandler) AddPayer(params player.PostRostersIDAddPlayerParams, _ interface{}) middleware.Responder
- func (h *RosterHandler) GetRosterActive(params roster.GetRostersIDActiveParams) middleware.Responder
- func (h *RosterHandler) GetRosterAll(params roster.GetRostersParams) middleware.Responder
- func (h *RosterHandler) GetRosterBenched(params roster.GetRostersIDBenchedParams) middleware.Responder
- func (h *RosterHandler) GetRosterOne(params roster.GetRostersIDParams) middleware.Responder
- func (h *RosterHandler) RearrangeRoster(params player.PostRostersIDRearrangeParams, _ interface{}) middleware.Responder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct { DB DatabaseAuthService // contains filtered or unexported fields }
AuthHandler is an authentication API request handler
func NewAuthHandler ¶
func NewAuthHandler(authKey string, db DatabaseAuthService) *AuthHandler
NewAuthHandler creates a new authentication API request handler
func (*AuthHandler) Authenticate ¶
func (h *AuthHandler) Authenticate(tokenString string) (interface{}, error)
Authenticate validates a JWT
func (*AuthHandler) HandleLogin ¶
func (h *AuthHandler) HandleLogin(params auth.PostLoginParams) middleware.Responder
HandleLogin checks user credentials and issues a JWT
func (*AuthHandler) HandleRegistration ¶
func (h *AuthHandler) HandleRegistration(params auth.PostRegisterParams) middleware.Responder
type DatabaseAuthService ¶
type DatabaseAuthService interface { AddUser(c dbModels.Credentials) error GetUser(login string) (*dbModels.Credentials, error) }
DatabaseService is a abstract database layer interface
type DatabaseRosterService ¶
type DatabaseRosterService interface { GetAllRosters() ([]dbModels.Roster, error) GetRoster(id int64) (*dbModels.Roster, error) PushPlayer(id int64, p dbModels.Player) error UpdateRoster(dbModels.Roster) error }
DatabaseRosterService is a abstract database layer interface
type IDGeneratorFunc ¶
type IDGeneratorFunc func() int64
func (IDGeneratorFunc) Generate ¶
func (g IDGeneratorFunc) Generate() int64
type RosterHandler ¶
type RosterHandler struct { DB DatabaseRosterService IDGen IDGeneratorFunc }
RosterHandler is a handler for roster API requests
func NewRosterHandler ¶
func NewRosterHandler(db DatabaseRosterService) *RosterHandler
NewRosterHandler creates a new web API handler
func (*RosterHandler) AddPayer ¶
func (h *RosterHandler) AddPayer(params player.PostRostersIDAddPlayerParams, _ interface{}) middleware.Responder
AddPayer adds a player to the roster
func (*RosterHandler) GetRosterActive ¶
func (h *RosterHandler) GetRosterActive(params roster.GetRostersIDActiveParams) middleware.Responder
GetRosterActive returns a certain roster with active players
func (*RosterHandler) GetRosterAll ¶
func (h *RosterHandler) GetRosterAll(params roster.GetRostersParams) middleware.Responder
GetRosterAll returns a list of all rosters
func (*RosterHandler) GetRosterBenched ¶
func (h *RosterHandler) GetRosterBenched(params roster.GetRostersIDBenchedParams) middleware.Responder
GetRosterBenched returns a certain roster with benched players
func (*RosterHandler) GetRosterOne ¶
func (h *RosterHandler) GetRosterOne(params roster.GetRostersIDParams) middleware.Responder
GetRosterOne returns a certain roster
func (*RosterHandler) RearrangeRoster ¶
func (h *RosterHandler) RearrangeRoster(params player.PostRostersIDRearrangeParams, _ interface{}) middleware.Responder
RearrangeRoster rearranges players in a certain roster