interfaces

package
v0.0.0-...-8050842 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	ErrSizeTooLarge = errors.New("size cannot be smaller than 1 or larger than 50")
	ErrPageTooSmall = errors.New("page cannot be smaller than 1")
	ErrMissingKey   = errors.New("missing key")
)

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 CategoryKey

type CategoryKey = string

CategoryKey defines model for CategoryKey.

type Competition

type Competition struct {
	// competition key
	Key string `json:"key"`

	// competition name
	Name *string `json:"name,omitempty"`
}

Competition defines model for Competition.

type CompetitionKey

type CompetitionKey = string

CompetitionKey defines model for CompetitionKey.

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

type Event_Market struct {
	AdditionalProperties map[string]Market `json:"-"`
}

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 First

type First = int32

First defines model for First.

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) GetEvent

func (h HttpServer) GetEvent(c *gin.Context, eventKey string)

func (HttpServer) GetSport

func (h HttpServer) GetSport(c *gin.Context, sportKey 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

type Market_Submarkets struct {
	AdditionalProperties map[string][]Selection `json:"-"`
}

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 MiddlewareFunc func(c *gin.Context)

type Page

type Page = int32

Page defines model for Page.

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

type Sport

type Sport struct {
	// sport key
	Key string `json:"key"`

	// average time of event stay in trading_live status
	LiveTime *float64 `json:"liveTime,omitempty"`

	// sport name
	Name *string `json:"name,omitempty"`
}

Sport defines model for Sport.

type SportKey

type SportKey = string

SportKey defines model for SportKey.

type Team

type Team struct {
	// Abbreviation
	Abbreviation *string `json:"abbreviation,omitempty"`

	// team key
	Key string `json:"key"`

	// team name
	Name *string `json:"name,omitempty"`

	// Nationality
	Nationality *string `json:"nationality,omitempty"`
}

Team defines model for Team.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL