Documentation ¶
Index ¶
- func ApplyForMembershipHandler(app *App) func(c echo.Context) error
- func ApproveOrDenyMembershipApplicationHandler(app *App) func(c echo.Context) error
- func ApproveOrDenyMembershipInvitationHandler(app *App) func(c echo.Context) error
- func CreateClanHandler(app *App) func(c echo.Context) error
- func CreateGameHandler(app *App) func(c echo.Context) error
- func CreateHookHandler(app *App) func(c echo.Context) error
- func CreatePlayerHandler(app *App) func(c echo.Context) error
- func DeleteMembershipHandler(app *App) func(c echo.Context) error
- func FailWith(status int, message string, c echo.Context) error
- func FailWithError(err error, c echo.Context) error
- func GetRequestBody(c echo.Context) ([]byte, error)
- func GetRequestJSON(payloadStruct interface{}, c echo.Context) error
- func GetTX(c echo.Context) newrelic.Transaction
- func HealthCheckHandler(app *App) func(c echo.Context) error
- func InviteForMembershipHandler(app *App) func(c echo.Context) error
- func LeaveClanHandler(app *App) func(c echo.Context) error
- func ListClansHandler(app *App) func(c echo.Context) error
- func LoadJSONPayload(payloadStruct interface{}, c echo.Context, l zap.Logger) error
- func PromoteOrDemoteMembershipHandler(app *App, action string) func(c echo.Context) error
- func RemoveHookHandler(app *App) func(c echo.Context) error
- func RetrieveClanHandler(app *App) func(c echo.Context) error
- func RetrieveClanMembersHandler(app *App) func(c echo.Context) error
- func RetrieveClanSummaryHandler(app *App) func(c echo.Context) error
- func RetrieveClansSummariesHandler(app *App) func(c echo.Context) error
- func RetrievePlayerHandler(app *App) func(c echo.Context) error
- func SearchClansHandler(app *App) func(c echo.Context) error
- func SetRetrieveClanHandlerConfigurationDefaults(config *viper.Viper)
- func StatusHandler(app *App) func(c echo.Context) error
- func SucceedWith(payload map[string]interface{}, c echo.Context) error
- func TransferOwnershipHandler(app *App) func(c echo.Context) error
- func UpdateClanHandler(app *App) func(c echo.Context) error
- func UpdateGameHandler(app *App) func(c echo.Context) error
- func UpdatePlayerHandler(app *App) func(c echo.Context) error
- func ValidatePayload(payload Validatable) []string
- func WithSegment(name string, c echo.Context, f func() error) error
- type App
- func (app *App) BeginTrans(ctx context.Context, l zap.Logger) (gorp.Transaction, error)
- func (app *App) Commit(tx gorp.Transaction, msg string, c echo.Context, l zap.Logger) error
- func (app *App) Configure()
- func (app *App) Db(ctx context.Context) gorp.Database
- func (app *App) DispatchHooks(gameID string, eventType int, payload map[string]interface{}) error
- func (app *App) GetCtxDB(ctx echo.Context) (gorp.Database, error)
- func (app *App) GetGame(ctx context.Context, gameID string) (*models.Game, error)
- func (app *App) GetHooks(ctx context.Context) map[string]map[int][]*models.Hook
- func (app *App) NonblockingStartWorkers()
- func (app *App) Rollback(tx gorp.Transaction, msg string, c echo.Context, l zap.Logger, err error) error
- func (app *App) Start()
- func (app *App) StartWorkers()
- type ApplyForMembershipPayload
- type ApproveOrDenyMembershipInvitationPayload
- type BasePayloadWithRequestorAndPlayerPublicIDs
- type BodyExtractionMiddleware
- type CreateClanPayload
- type CreateGamePayload
- type CreatePlayerPayload
- type Dispatcher
- type EasyJSONMarshaler
- type EasyJSONUnmarshaler
- type HookPayload
- type InviteForMembershipPayload
- type LoggerMiddleware
- type NewRelicMiddleware
- type RecoveryMiddleware
- type SentryMiddleware
- type TransferClanOwnershipPayload
- type UpdateClanPayload
- type UpdateGamePayload
- type UpdatePlayerPayload
- type Validatable
- type Validation
- type VersionMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyForMembershipHandler ¶
ApplyForMembershipHandler is the handler responsible for applying for new memberships
func ApproveOrDenyMembershipApplicationHandler ¶
ApproveOrDenyMembershipApplicationHandler is the handler responsible for approving or denying a membership invitation
func ApproveOrDenyMembershipInvitationHandler ¶
ApproveOrDenyMembershipInvitationHandler is the handler responsible for approving or denying a membership invitation
func CreateClanHandler ¶
CreateClanHandler is the handler responsible for creating new clans
func CreateGameHandler ¶
CreateGameHandler is the handler responsible for creating new games
func CreateHookHandler ¶
CreateHookHandler is the handler responsible for creating new hooks
func CreatePlayerHandler ¶
CreatePlayerHandler is the handler responsible for creating new players
func DeleteMembershipHandler ¶
DeleteMembershipHandler is the handler responsible for deleting a member
func FailWithError ¶
FailWithError fails with the specified error
func GetRequestBody ¶ added in v0.9.15
GetRequestBody from echo context
func GetRequestJSON ¶ added in v0.9.15
GetRequestJSON as the specified interface from echo context
func GetTX ¶ added in v0.10.0
func GetTX(c echo.Context) newrelic.Transaction
GetTX returns new relic transaction
func HealthCheckHandler ¶
HealthCheckHandler is the handler responsible for validating that the app is still up
func InviteForMembershipHandler ¶
InviteForMembershipHandler is the handler responsible for creating new memberships
func LeaveClanHandler ¶
LeaveClanHandler is the handler responsible for changing the clan ownership when the owner leaves it
func ListClansHandler ¶
ListClansHandler is the handler responsible for returning a list of all clans
func LoadJSONPayload ¶
LoadJSONPayload loads the JSON payload to the given struct validating all fields are not null
func PromoteOrDemoteMembershipHandler ¶
PromoteOrDemoteMembershipHandler is the handler responsible for promoting or demoting a member
func RemoveHookHandler ¶
RemoveHookHandler is the handler responsible for removing existing hooks
func RetrieveClanHandler ¶
RetrieveClanHandler is the handler responsible for returning details for a given clan
func RetrieveClanMembersHandler ¶
RetrieveClanMembersHandler retrieves only the clan users
func RetrieveClanSummaryHandler ¶
RetrieveClanSummaryHandler is the handler responsible for returning details summary for a given clan
func RetrieveClansSummariesHandler ¶
RetrieveClansSummariesHandler is the handler responsible for returning details summary for a given list of clans
func RetrievePlayerHandler ¶
RetrievePlayerHandler is the handler responsible for returning details for a given player
func SearchClansHandler ¶
SearchClansHandler is the handler responsible for searching for clans
func SetRetrieveClanHandlerConfigurationDefaults ¶
SetRetrieveClanHandlerConfigurationDefaults sets the default configs for RetrieveClanHandler
func StatusHandler ¶
StatusHandler is the handler responsible for reporting khan status
func SucceedWith ¶
SucceedWith sends payload to user with status 200
func TransferOwnershipHandler ¶
TransferOwnershipHandler is the handler responsible for transferring the clan ownership to another clan member
func UpdateClanHandler ¶
UpdateClanHandler is the handler responsible for updating existing clans
func UpdateGameHandler ¶
UpdateGameHandler is the handler responsible for updating existing
func UpdatePlayerHandler ¶
UpdatePlayerHandler is the handler responsible for updating existing
func ValidatePayload ¶ added in v0.9.15
func ValidatePayload(payload Validatable) []string
ValidatePayload for any validatable payload
Types ¶
type App ¶
type App struct { ID string Test bool Debug bool Port int Host string ConfigPath string Errors metrics.EWMA App *eecho.Echo Engine engine.Server Config *viper.Viper Dispatcher *Dispatcher ESWorker *models.ESWorker MongoWorker *models.MongoWorker Logger zap.Logger ESClient *es.Client MongoDB interfaces.MongoDB ReadBufferSize int Fast bool NewRelic newrelic.Application DDStatsD *extnethttpmiddleware.DogStatsD // contains filtered or unexported fields }
App is a struct that represents a Khan API Application
func GetApp ¶
func GetApp(host string, port int, configPath string, debug bool, logger zap.Logger, fast, test bool) *App
GetApp returns a new Khan API Application
func (*App) BeginTrans ¶
BeginTrans in the current Db connection
func (*App) Configure ¶
func (app *App) Configure()
Configure instantiates the required dependencies for Khan Api Application
func (*App) DispatchHooks ¶
DispatchHooks dispatches web hooks for a specific game and event type
func (*App) GetCtxDB ¶
GetCtxDB returns the proper database connection depending on the request context
func (*App) NonblockingStartWorkers ¶
func (app *App) NonblockingStartWorkers()
NonblockingStartWorkers non-blocking
func (*App) Rollback ¶
func (app *App) Rollback(tx gorp.Transaction, msg string, c echo.Context, l zap.Logger, err error) error
Rollback transaction
type ApplyForMembershipPayload ¶ added in v0.9.15
type ApplyForMembershipPayload struct { Level string `json:"level"` PlayerPublicID string `json:"playerPublicID"` }
ApplyForMembershipPayload maps the payload required for the Apply for Membership route
func (ApplyForMembershipPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v ApplyForMembershipPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*ApplyForMembershipPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *ApplyForMembershipPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ApplyForMembershipPayload) Validate ¶ added in v0.9.15
func (afmp *ApplyForMembershipPayload) Validate() []string
Validate all the required fields
type ApproveOrDenyMembershipInvitationPayload ¶ added in v0.9.15
type ApproveOrDenyMembershipInvitationPayload struct {
PlayerPublicID string `json:"playerPublicID"`
}
ApproveOrDenyMembershipInvitationPayload maps the payload required for Approving or Denying a membership
func (ApproveOrDenyMembershipInvitationPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v ApproveOrDenyMembershipInvitationPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*ApproveOrDenyMembershipInvitationPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *ApproveOrDenyMembershipInvitationPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ApproveOrDenyMembershipInvitationPayload) Validate ¶ added in v0.9.15
func (admip *ApproveOrDenyMembershipInvitationPayload) Validate() []string
Validate all the required fields
type BasePayloadWithRequestorAndPlayerPublicIDs ¶ added in v0.9.15
type BasePayloadWithRequestorAndPlayerPublicIDs struct { PlayerPublicID string `json:"playerPublicID"` RequestorPublicID string `json:"requestorPublicID"` }
BasePayloadWithRequestorAndPlayerPublicIDs maps the payload required for many routes
func (BasePayloadWithRequestorAndPlayerPublicIDs) MarshalEasyJSON ¶ added in v0.9.15
func (v BasePayloadWithRequestorAndPlayerPublicIDs) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*BasePayloadWithRequestorAndPlayerPublicIDs) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *BasePayloadWithRequestorAndPlayerPublicIDs) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BasePayloadWithRequestorAndPlayerPublicIDs) Validate ¶ added in v0.9.15
func (base *BasePayloadWithRequestorAndPlayerPublicIDs) Validate() []string
Validate all the required fields
type BodyExtractionMiddleware ¶ added in v0.11.1
type BodyExtractionMiddleware struct{}
BodyExtractionMiddleware extracts the body
func NewBodyExtractionMiddleware ¶ added in v0.11.1
func NewBodyExtractionMiddleware() *BodyExtractionMiddleware
NewBodyExtractionMiddleware with API version
func (*BodyExtractionMiddleware) Serve ¶ added in v0.11.1
func (v *BodyExtractionMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve serves the middleware
type CreateClanPayload ¶ added in v0.9.15
type CreateClanPayload struct { PublicID string `json:"publicID"` Name string `json:"name"` OwnerPublicID string `json:"ownerPublicID"` Metadata map[string]interface{} `json:"metadata"` AllowApplication bool `json:"allowApplication"` AutoJoin bool `json:"autoJoin"` }
CreateClanPayload maps the payload for the Create Clan route
func (CreateClanPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v CreateClanPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CreateClanPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *CreateClanPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateClanPayload) Validate ¶ added in v0.9.15
func (ccp *CreateClanPayload) Validate() []string
Validate all the required fields for creating a clan
type CreateGamePayload ¶ added in v0.9.15
type CreateGamePayload struct { PublicID string `json:"publicID"` Name string `json:"name"` MembershipLevels map[string]interface{} `json:"membershipLevels"` Metadata map[string]interface{} `json:"metadata"` MinLevelToAcceptApplication int `json:"minLevelToAcceptApplication"` MinLevelToCreateInvitation int `json:"minLevelToCreateInvitation"` MinLevelToRemoveMember int `json:"minLevelToRemoveMember"` MinLevelOffsetToRemoveMember int `json:"minLevelOffsetToRemoveMember"` MinLevelOffsetToPromoteMember int `json:"minLevelOffsetToPromoteMember"` MinLevelOffsetToDemoteMember int `json:"minLevelOffsetToDemoteMember"` MaxMembers int `json:"maxMembers"` MaxClansPerPlayer int `json:"maxClansPerPlayer"` CooldownAfterDeny int `json:"cooldownAfterDeny"` CooldownAfterDelete int `json:"cooldownAfterDelete"` }
CreateGamePayload maps the payload required for the Create game route
func (CreateGamePayload) MarshalEasyJSON ¶ added in v0.9.15
func (v CreateGamePayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CreateGamePayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *CreateGamePayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateGamePayload) Validate ¶ added in v0.9.15
func (p *CreateGamePayload) Validate() []string
Validate the create game payload
type CreatePlayerPayload ¶ added in v0.9.15
type CreatePlayerPayload struct { PublicID string `json:"publicID"` Name string `json:"name"` Metadata map[string]interface{} `json:"metadata"` }
CreatePlayerPayload maps the payload for the Create Player route
func (CreatePlayerPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v CreatePlayerPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CreatePlayerPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *CreatePlayerPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreatePlayerPayload) Validate ¶ added in v0.9.15
func (cpp *CreatePlayerPayload) Validate() []string
Validate all the required fields for creating a player
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher is responsible for sending web hooks to workers
func NewDispatcher ¶
func NewDispatcher(app *App) (*Dispatcher, error)
NewDispatcher creates a new dispatcher available to our app
func (*Dispatcher) DispatchHook ¶
func (d *Dispatcher) DispatchHook(gameID string, eventType int, payload map[string]interface{})
DispatchHook dispatches an event hook for eventType to gameID with the specified payload
func (*Dispatcher) PerformDispatchHook ¶
func (d *Dispatcher) PerformDispatchHook(m *workers.Msg)
PerformDispatchHook dispatches web hooks for a specific game and event type
type EasyJSONMarshaler ¶ added in v0.9.15
EasyJSONMarshaler describes a struct able to marshal json
type EasyJSONUnmarshaler ¶ added in v0.9.15
EasyJSONUnmarshaler describes a struct able to unmarshal json
type HookPayload ¶ added in v0.9.15
HookPayload maps the payload required to create or update hooks
func (HookPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v HookPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*HookPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *HookPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*HookPayload) Validate ¶ added in v0.9.15
func (hp *HookPayload) Validate() []string
Validate all the required fields
type InviteForMembershipPayload ¶ added in v0.9.15
type InviteForMembershipPayload struct { Level string `json:"level"` PlayerPublicID string `json:"playerPublicID"` RequestorPublicID string `json:"requestorPublicID"` }
InviteForMembershipPayload maps the payload required for the Invite for Membership route
func (InviteForMembershipPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v InviteForMembershipPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*InviteForMembershipPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *InviteForMembershipPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*InviteForMembershipPayload) Validate ¶ added in v0.9.15
func (ifmp *InviteForMembershipPayload) Validate() []string
Validate all the required fields
type LoggerMiddleware ¶
LoggerMiddleware is responsible for logging to Zap all requests
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(theLogger zap.Logger) *LoggerMiddleware
NewLoggerMiddleware returns the logger middleware
func (*LoggerMiddleware) Serve ¶
func (l *LoggerMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve serves the middleware
type NewRelicMiddleware ¶ added in v0.10.0
NewRelicMiddleware is responsible for logging to Zap all requests
func NewNewRelicMiddleware ¶ added in v0.10.0
func NewNewRelicMiddleware(app *App, theLogger zap.Logger) *NewRelicMiddleware
NewNewRelicMiddleware returns the logger middleware
func (*NewRelicMiddleware) Serve ¶ added in v0.10.0
func (nr *NewRelicMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve serves the middleware
type RecoveryMiddleware ¶
RecoveryMiddleware recovers from errors
func NewRecoveryMiddleware ¶ added in v0.9.15
func NewRecoveryMiddleware(onError func(error, []byte)) *RecoveryMiddleware
NewRecoveryMiddleware returns a configured middleware
func (*RecoveryMiddleware) Serve ¶
func (r *RecoveryMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve executes on error handler when errors happen
type SentryMiddleware ¶
type SentryMiddleware struct {
App *App
}
SentryMiddleware is responsible for sending all exceptions to sentry
func NewSentryMiddleware ¶ added in v0.9.15
func NewSentryMiddleware(app *App) *SentryMiddleware
NewSentryMiddleware returns a new sentry middleware
func (*SentryMiddleware) Serve ¶
func (s *SentryMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve serves the middleware
type TransferClanOwnershipPayload ¶ added in v0.9.15
type TransferClanOwnershipPayload struct {
PlayerPublicID string `json:"playerPublicID"`
}
TransferClanOwnershipPayload maps the payload for the Transfer Clan Ownership route
func (TransferClanOwnershipPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v TransferClanOwnershipPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*TransferClanOwnershipPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *TransferClanOwnershipPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransferClanOwnershipPayload) Validate ¶ added in v0.9.15
func (tcop *TransferClanOwnershipPayload) Validate() []string
Validate all the required fields for transferring a clan ownership
type UpdateClanPayload ¶ added in v0.9.15
type UpdateClanPayload struct { Name string `json:"name"` OwnerPublicID string `json:"ownerPublicID"` Metadata map[string]interface{} `json:"metadata"` AllowApplication bool `json:"allowApplication"` AutoJoin bool `json:"autoJoin"` }
UpdateClanPayload maps the payload for the Update Clan route
func (UpdateClanPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v UpdateClanPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*UpdateClanPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *UpdateClanPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateClanPayload) Validate ¶ added in v0.9.15
func (ucp *UpdateClanPayload) Validate() []string
Validate all the required fields for updating a clan
type UpdateGamePayload ¶ added in v0.9.15
type UpdateGamePayload struct { Name string `json:"name"` MembershipLevels map[string]interface{} `json:"membershipLevels"` Metadata map[string]interface{} `json:"metadata"` MinLevelToAcceptApplication int `json:"minLevelToAcceptApplication"` MinLevelToCreateInvitation int `json:"minLevelToCreateInvitation"` MinLevelToRemoveMember int `json:"minLevelToRemoveMember"` MinLevelOffsetToRemoveMember int `json:"minLevelOffsetToRemoveMember"` MinLevelOffsetToPromoteMember int `json:"minLevelOffsetToPromoteMember"` MinLevelOffsetToDemoteMember int `json:"minLevelOffsetToDemoteMember"` MaxMembers int `json:"maxMembers"` MaxClansPerPlayer int `json:"maxClansPerPlayer"` CooldownAfterDeny int `json:"cooldownAfterDeny"` CooldownAfterDelete int `json:"cooldownAfterDelete"` }
UpdateGamePayload maps the payload required for the Update game route
func (UpdateGamePayload) MarshalEasyJSON ¶ added in v0.9.15
func (v UpdateGamePayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*UpdateGamePayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *UpdateGamePayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateGamePayload) Validate ¶ added in v0.9.15
func (p *UpdateGamePayload) Validate() []string
Validate the update game payload
type UpdatePlayerPayload ¶ added in v0.9.15
type UpdatePlayerPayload struct { Name string `json:"name"` Metadata map[string]interface{} `json:"metadata"` }
UpdatePlayerPayload maps the payload for the Update Player route
func (UpdatePlayerPayload) MarshalEasyJSON ¶ added in v0.9.15
func (v UpdatePlayerPayload) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*UpdatePlayerPayload) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *UpdatePlayerPayload) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdatePlayerPayload) Validate ¶ added in v0.9.15
func (upp *UpdatePlayerPayload) Validate() []string
Validate all the required fields for updating a player
type Validatable ¶ added in v0.9.15
type Validatable interface {
Validate() []string
}
Validatable indicates that a struct can be validated
type Validation ¶ added in v0.9.15
type Validation struct {
// contains filtered or unexported fields
}
Validation struct
func NewValidation ¶ added in v0.9.15
func NewValidation() *Validation
NewValidation for validating structs
func (*Validation) Errors ¶ added in v0.9.15
func (v *Validation) Errors() []string
Errors in validation
func (Validation) MarshalEasyJSON ¶ added in v0.9.15
func (v Validation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Validation) UnmarshalEasyJSON ¶ added in v0.9.15
func (v *Validation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type VersionMiddleware ¶
type VersionMiddleware struct {
Version string
}
VersionMiddleware inserts the current version in all requests
func NewVersionMiddleware ¶ added in v0.9.15
func NewVersionMiddleware() *VersionMiddleware
NewVersionMiddleware with API version
func (*VersionMiddleware) Serve ¶
func (v *VersionMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc
Serve serves the middleware