Documentation
¶
Overview ¶
Package interfaces provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Package interfaces provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Index ¶
- Variables
- func NewHandler(httpServer HttpServer) *gin.Engine
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type Category
- type CategoryKey
- type Competition
- type CompetitionKey
- type Error
- type Event
- type Event_Market
- type First
- type GinServerOptions
- type HttpServer
- func (h HttpServer) GetCategory(c *gin.Context, categoryKey string)
- func (h HttpServer) GetCompetition(c *gin.Context, competitionKey string)
- func (h HttpServer) GetEvent(c *gin.Context, eventKey string)
- func (h HttpServer) GetSport(c *gin.Context, sportKey string)
- func (h HttpServer) ListCategories(c *gin.Context, params ListCategoriesParams)
- func (h HttpServer) ListCompetitions(c *gin.Context, params ListCompetitionsParams)
- func (h HttpServer) ListEvents(c *gin.Context, params ListEventsParams)
- func (h HttpServer) ListSports(c *gin.Context, params ListSportsParams)
- type ListCategoriesParams
- type ListCompetitionsParams
- type ListEventsParams
- type ListSportsParams
- type Market
- type Market_Submarkets
- type MiddlewareFunc
- type Page
- type Selection
- type SelectionSide
- type SelectionStatus
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetCategory(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetCompetition(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetSport(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListCategories(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListCompetitions(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListEvents(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListSports(c *gin.Context)
- type Sport
- type SportKey
- type Team
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewHandler ¶
func NewHandler(httpServer HttpServer) *gin.Engine
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type Category ¶
type Category struct {
// category key
Key string `json:"key"`
// category name
Name *string `json:"name,omitempty"`
}
Category defines model for Category.
type Competition ¶
type Competition struct {
// competition key
Key string `json:"key"`
// competition name
Name *string `json:"name,omitempty"`
}
Competition defines model for Competition.
type Error ¶
type Error struct {
Error *string `json:"error,omitempty"`
}
Error defines model for Error.
type Event ¶
type Event struct {
Active bool `json:"active"`
Away *Team `json:"away,omitempty"`
// category
Category *struct {
// category key
Key *string `json:"key,omitempty"`
// category name
Name *string `json:"name,omitempty"`
} `json:"category,omitempty"`
// competition
Competition *struct {
// competition key
Key *string `json:"key,omitempty"`
// competition name
Name *string `json:"name,omitempty"`
} `json:"competition,omitempty"`
// Cut off time
CutOffTime *string `json:"cutOffTime,omitempty"`
Home *Team `json:"home,omitempty"`
// time that changed status to inactive
InactiveTime *string `json:"inactiveTime,omitempty"`
// event key
Key string `json:"key"`
// market info
Market *Event_Market `json:"market,omitempty"`
// event name
Name *string `json:"name,omitempty"`
// sport info
Sport *struct {
// sport key
Key *string `json:"key,omitempty"`
// sport name
Name *string `json:"name,omitempty"`
} `json:"sport,omitempty"`
// time that changed status to TRADING_LIVE
StartTradingLiveTime *string `json:"startTradingLiveTime,omitempty"`
}
Event defines model for Event.
type Event_Market ¶
market info
func (Event_Market) Get ¶
func (a Event_Market) Get(fieldName string) (value Market, found bool)
Getter for additional properties for Event_Market. Returns the specified element and whether it was found
func (Event_Market) MarshalJSON ¶
func (a Event_Market) MarshalJSON() ([]byte, error)
Override default JSON handling for Event_Market to handle AdditionalProperties
func (*Event_Market) Set ¶
func (a *Event_Market) Set(fieldName string, value Market)
Setter for additional properties for Event_Market
func (*Event_Market) UnmarshalJSON ¶
func (a *Event_Market) UnmarshalJSON(b []byte) error
Override default JSON handling for Event_Market to handle AdditionalProperties
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
}
GinServerOptions provides options for the Gin server.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(app application.Application) *HttpServer
func (HttpServer) GetCategory ¶
func (h HttpServer) GetCategory(c *gin.Context, categoryKey string)
func (HttpServer) GetCompetition ¶
func (h HttpServer) GetCompetition(c *gin.Context, competitionKey string)
func (HttpServer) ListCategories ¶
func (h HttpServer) ListCategories(c *gin.Context, params ListCategoriesParams)
func (HttpServer) ListCompetitions ¶
func (h HttpServer) ListCompetitions(c *gin.Context, params ListCompetitionsParams)
func (HttpServer) ListEvents ¶
func (h HttpServer) ListEvents(c *gin.Context, params ListEventsParams)
func (HttpServer) ListSports ¶
func (h HttpServer) ListSports(c *gin.Context, params ListSportsParams)
type ListCategoriesParams ¶
type ListCategoriesParams struct {
// first n items to be queried
First First `form:"first" json:"first"`
// page number
Page Page `form:"page" json:"page"`
// sport key for filtering
Sport *SportKey `form:"sport,omitempty" json:"sport,omitempty"`
}
ListCategoriesParams defines parameters for ListCategories.
type ListCompetitionsParams ¶
type ListCompetitionsParams struct {
// first n items to be queried
First First `form:"first" json:"first"`
// page number
Page Page `form:"page" json:"page"`
// sport key for filtering
Sport *SportKey `form:"sport,omitempty" json:"sport,omitempty"`
}
ListCompetitionsParams defines parameters for ListCompetitions.
type ListEventsParams ¶
type ListEventsParams struct {
// first n items to be queried
First First `form:"first" json:"first"`
// page number
Page Page `form:"page" json:"page"`
// sport key for filtering
Sport *SportKey `form:"sport,omitempty" json:"sport,omitempty"`
// competition key for filtering
Competition *CompetitionKey `form:"competition,omitempty" json:"competition,omitempty"`
// category key for filtering
Category *CategoryKey `form:"category,omitempty" json:"category,omitempty"`
}
ListEventsParams defines parameters for ListEvents.
type ListSportsParams ¶
type ListSportsParams struct {
// first n items to be queried
First First `form:"first" json:"first"`
// page number
Page Page `form:"page" json:"page"`
}
ListSportsParams defines parameters for ListSports.
type Market ¶
type Market struct {
Submarkets *Market_Submarkets `json:"submarkets,omitempty"`
}
Market defines model for Market.
type Market_Submarkets ¶
Market_Submarkets defines model for Market.Submarkets.
func (Market_Submarkets) Get ¶
func (a Market_Submarkets) Get(fieldName string) (value []Selection, found bool)
Getter for additional properties for Market_Submarkets. Returns the specified element and whether it was found
func (Market_Submarkets) MarshalJSON ¶
func (a Market_Submarkets) MarshalJSON() ([]byte, error)
Override default JSON handling for Market_Submarkets to handle AdditionalProperties
func (*Market_Submarkets) Set ¶
func (a *Market_Submarkets) Set(fieldName string, value []Selection)
Setter for additional properties for Market_Submarkets
func (*Market_Submarkets) UnmarshalJSON ¶
func (a *Market_Submarkets) UnmarshalJSON(b []byte) error
Override default JSON handling for Market_Submarkets to handle AdditionalProperties
type MiddlewareFunc ¶
type Selection ¶
type Selection struct {
// maximum stake in EUR which can be placed in bets on this Selection; market liability = selection max stake * (price - 1);
MaxStake *float64 `json:"maxStake,omitempty"`
// minimum stake in EUR which can be placed in bets on this Selection
MinStake *float64 `json:"minStake,omitempty"`
Outcome *string `json:"outcome,omitempty"`
Params *string `json:"params,omitempty"`
// price at which bets can be placed on this Selection
Price *float64 `json:"price,omitempty"`
Probability *float64 `json:"probability,omitempty"`
// Side of a selection signals whether a selection is available for back or lay side betting
Side *SelectionSide `json:"side,omitempty"`
// SelectionStatus presents the current status for a given selection
Status *SelectionStatus `json:"status,omitempty"`
}
Selection defines model for Selection.
type SelectionSide ¶
type SelectionSide string
Side of a selection signals whether a selection is available for back or lay side betting
const ( BACK SelectionSide = "BACK" LAY SelectionSide = "LAY" )
Defines values for SelectionSide.
type SelectionStatus ¶
type SelectionStatus string
SelectionStatus presents the current status for a given selection
const ( SELECTIONDISABLED SelectionStatus = "SELECTION_DISABLED" SELECTIONENABLED SelectionStatus = "SELECTION_ENABLED" )
Defines values for SelectionStatus.
type ServerInterface ¶
type ServerInterface interface {
// List categories
// (GET /category)
ListCategories(c *gin.Context, params ListCategoriesParams)
// Get category info
// (GET /category/{categoryKey})
GetCategory(c *gin.Context, categoryKey string)
// List competitions
// (GET /competition)
ListCompetitions(c *gin.Context, params ListCompetitionsParams)
// Get competition info
// (GET /competition/{competitionKey})
GetCompetition(c *gin.Context, competitionKey string)
// List events
// (GET /event)
ListEvents(c *gin.Context, params ListEventsParams)
// Get event info
// (GET /event/{eventKey})
GetEvent(c *gin.Context, eventKey string)
// List sports
// (GET /sport)
ListSports(c *gin.Context, params ListSportsParams)
// Get sport info
// (GET /sport/{sportKey})
GetSport(c *gin.Context, sportKey string)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetCategory ¶
func (siw *ServerInterfaceWrapper) GetCategory(c *gin.Context)
GetCategory operation middleware
func (*ServerInterfaceWrapper) GetCompetition ¶
func (siw *ServerInterfaceWrapper) GetCompetition(c *gin.Context)
GetCompetition operation middleware
func (*ServerInterfaceWrapper) GetEvent ¶
func (siw *ServerInterfaceWrapper) GetEvent(c *gin.Context)
GetEvent operation middleware
func (*ServerInterfaceWrapper) GetSport ¶
func (siw *ServerInterfaceWrapper) GetSport(c *gin.Context)
GetSport operation middleware
func (*ServerInterfaceWrapper) ListCategories ¶
func (siw *ServerInterfaceWrapper) ListCategories(c *gin.Context)
ListCategories operation middleware
func (*ServerInterfaceWrapper) ListCompetitions ¶
func (siw *ServerInterfaceWrapper) ListCompetitions(c *gin.Context)
ListCompetitions operation middleware
func (*ServerInterfaceWrapper) ListEvents ¶
func (siw *ServerInterfaceWrapper) ListEvents(c *gin.Context)
ListEvents operation middleware
func (*ServerInterfaceWrapper) ListSports ¶
func (siw *ServerInterfaceWrapper) ListSports(c *gin.Context)
ListSports operation middleware