Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Byte(b byte) *byte
- func Bytes(b []byte) *[]byte
- func Complex64(c complex64) *complex64
- func Complex128(c complex128) *complex128
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int8(i int8) *int8
- func Int16(i int16) *int16
- func Int32(i int32) *int32
- func Int64(i int64) *int64
- func MustParseDate(date string) time.Time
- func MustParseDateTime(datetime string) time.Time
- func Rune(r rune) *rune
- func String(s string) *string
- func Time(t time.Time) *time.Time
- func UUID(u uuid.UUID) *uuid.UUID
- func Uint(u uint) *uint
- func Uint8(u uint8) *uint8
- func Uint16(u uint16) *uint16
- func Uint32(u uint32) *uint32
- func Uint64(u uint64) *uint64
- func Uintptr(u uintptr) *uintptr
- type BadRequestError
- type ErrorResponse
- func (e *ErrorResponse) GetError() string
- func (e *ErrorResponse) GetExtraProperties() map[string]interface{}
- func (e *ErrorResponse) GetStatusCode() int
- func (e *ErrorResponse) MarshalJSON() ([]byte, error)
- func (e *ErrorResponse) SetError(error_ string)
- func (e *ErrorResponse) SetStatusCode(statusCode int)
- func (e *ErrorResponse) String() string
- func (e *ErrorResponse) UnmarshalJSON(data []byte) error
- type FileParam
- type FileParamOption
- type ForbiddenError
- type GetSportsMatchingMarketsRequest
- func (g *GetSportsMatchingMarketsRequest) SetKalshiEventTicker(kalshiEventTicker []*string)
- func (g *GetSportsMatchingMarketsRequest) SetPolymarketMarketSlug(polymarketMarketSlug []*string)
- func (g *GetSportsMatchingMarketsRequest) SetPredictMarketID(predictMarketID []*string)
- func (g *GetSportsMatchingMarketsRequest) SetSxbetMarketID(sxbetMarketID []*string)
- type PlatformMarket
- func (p *PlatformMarket) GetEventTicker() *string
- func (p *PlatformMarket) GetExtraProperties() map[string]interface{}
- func (p *PlatformMarket) GetMarketID() *string
- func (p *PlatformMarket) GetMarketSlug() *string
- func (p *PlatformMarket) GetMarketTickers() []string
- func (p *PlatformMarket) GetOutcomeIDs() []string
- func (p *PlatformMarket) GetPlatform() PlatformMarketPlatform
- func (p *PlatformMarket) GetTokenIDs() []string
- func (p *PlatformMarket) MarshalJSON() ([]byte, error)
- func (p *PlatformMarket) SetEventTicker(eventTicker *string)
- func (p *PlatformMarket) SetMarketID(marketID *string)
- func (p *PlatformMarket) SetMarketSlug(marketSlug *string)
- func (p *PlatformMarket) SetMarketTickers(marketTickers []string)
- func (p *PlatformMarket) SetOutcomeIDs(outcomeIDs []string)
- func (p *PlatformMarket) SetPlatform(platform PlatformMarketPlatform)
- func (p *PlatformMarket) SetTokenIDs(tokenIDs []string)
- func (p *PlatformMarket) String() string
- func (p *PlatformMarket) UnmarshalJSON(data []byte) error
- type PlatformMarketPlatform
- type ServiceUnavailableError
- type SportsMatchingResponse
- func (s *SportsMatchingResponse) GetExtraProperties() map[string]interface{}
- func (s *SportsMatchingResponse) GetMarkets() map[string][]*PlatformMarket
- func (s *SportsMatchingResponse) MarshalJSON() ([]byte, error)
- func (s *SportsMatchingResponse) SetMarkets(markets map[string][]*PlatformMarket)
- func (s *SportsMatchingResponse) String() string
- func (s *SportsMatchingResponse) UnmarshalJSON(data []byte) error
- type TooManyRequestsError
- type UnauthorizedError
Constants ¶
This section is empty.
Variables ¶
var Environments = struct { Production string }{ Production: "https://api.predictorsdk.com", }
Environments defines all of the API environments. These values can be used with the WithBaseURL RequestOption to override the client's default environment, if any.
var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{ 400: func(apiError *core.APIError) error { return &BadRequestError{ APIError: apiError, } }, 401: func(apiError *core.APIError) error { return &UnauthorizedError{ APIError: apiError, } }, 403: func(apiError *core.APIError) error { return &ForbiddenError{ APIError: apiError, } }, 429: func(apiError *core.APIError) error { return &TooManyRequestsError{ APIError: apiError, } }, 503: func(apiError *core.APIError) error { return &ServiceUnavailableError{ APIError: apiError, } }, }
Functions ¶
func Complex128 ¶
func Complex128(c complex128) *complex128
Complex128 returns a pointer to the given complex128 value.
func MustParseDate ¶
MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.
func MustParseDateTime ¶
MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.
Types ¶
type BadRequestError ¶
type BadRequestError struct {
*core.APIError
Body *ErrorResponse
}
Invalid query parameters (e.g. combining multiple filter types)
func (*BadRequestError) MarshalJSON ¶
func (b *BadRequestError) MarshalJSON() ([]byte, error)
func (*BadRequestError) UnmarshalJSON ¶
func (b *BadRequestError) UnmarshalJSON(data []byte) error
func (*BadRequestError) Unwrap ¶
func (b *BadRequestError) Unwrap() error
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error" url:"error"`
StatusCode int `json:"status_code" url:"status_code"`
// contains filtered or unexported fields
}
func (*ErrorResponse) GetError ¶
func (e *ErrorResponse) GetError() string
func (*ErrorResponse) GetExtraProperties ¶
func (e *ErrorResponse) GetExtraProperties() map[string]interface{}
func (*ErrorResponse) GetStatusCode ¶
func (e *ErrorResponse) GetStatusCode() int
func (*ErrorResponse) MarshalJSON ¶
func (e *ErrorResponse) MarshalJSON() ([]byte, error)
func (*ErrorResponse) SetError ¶
func (e *ErrorResponse) SetError(error_ string)
SetError sets the Error field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*ErrorResponse) SetStatusCode ¶
func (e *ErrorResponse) SetStatusCode(statusCode int)
SetStatusCode sets the StatusCode field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*ErrorResponse) String ¶
func (e *ErrorResponse) String() string
func (*ErrorResponse) UnmarshalJSON ¶
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
type FileParam ¶
FileParam is a file type suitable for multipart/form-data uploads.
func NewFileParam ¶
func NewFileParam( reader io.Reader, filename string, contentType string, opts ...FileParamOption, ) *FileParam
NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file upload endpoints accept a simple io.Reader, which is usually created by opening a file via os.Open.
However, some endpoints require additional metadata about the file such as a specific Content-Type or custom filename. FileParam makes it easier to create the correct type signature for these endpoints.
func (*FileParam) ContentType ¶
type FileParamOption ¶
type FileParamOption interface {
// contains filtered or unexported methods
}
FileParamOption adapts the behavior of the FileParam. No options are implemented yet, but this interface allows for future extensibility.
type ForbiddenError ¶
type ForbiddenError struct {
*core.APIError
Body *ErrorResponse
}
API key lacks the required permission
func (*ForbiddenError) MarshalJSON ¶
func (f *ForbiddenError) MarshalJSON() ([]byte, error)
func (*ForbiddenError) UnmarshalJSON ¶
func (f *ForbiddenError) UnmarshalJSON(data []byte) error
func (*ForbiddenError) Unwrap ¶
func (f *ForbiddenError) Unwrap() error
type GetSportsMatchingMarketsRequest ¶
type GetSportsMatchingMarketsRequest struct {
// Kalshi event ticker(s) to find matching markets for (e.g. `KXNFLGAME-25AUG16ARIDEN`). Provide the parameter multiple times for multiple tickers. Only one filter type may be used per request.
KalshiEventTicker []*string `json:"-" url:"kalshi_event_ticker,omitempty"`
// Polymarket market slug(s) to find matching markets for (e.g. `nfl-ari-den-2025-08-16`). Provide the parameter multiple times for multiple slugs. Only one filter type may be used per request.
PolymarketMarketSlug []*string `json:"-" url:"polymarket_market_slug,omitempty"`
// Predict market ID(s) to find matching markets for (e.g. `110629`). Provide the parameter multiple times for multiple IDs. Only one filter type may be used per request.
PredictMarketID []*string `json:"-" url:"predict_market_id,omitempty"`
// SX Bet market ID(s) to find matching markets for (e.g. `0x4c000abdbf197ef32ecdf15561b1d636f1e5b02629f466678757fd83e2ec3599`). Provide the parameter multiple times for multiple IDs. Only one filter type may be used per request.
SxbetMarketID []*string `json:"-" url:"sxbet_market_id,omitempty"`
// contains filtered or unexported fields
}
func (*GetSportsMatchingMarketsRequest) SetKalshiEventTicker ¶
func (g *GetSportsMatchingMarketsRequest) SetKalshiEventTicker(kalshiEventTicker []*string)
SetKalshiEventTicker sets the KalshiEventTicker field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*GetSportsMatchingMarketsRequest) SetPolymarketMarketSlug ¶
func (g *GetSportsMatchingMarketsRequest) SetPolymarketMarketSlug(polymarketMarketSlug []*string)
SetPolymarketMarketSlug sets the PolymarketMarketSlug field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*GetSportsMatchingMarketsRequest) SetPredictMarketID ¶
func (g *GetSportsMatchingMarketsRequest) SetPredictMarketID(predictMarketID []*string)
SetPredictMarketID sets the PredictMarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*GetSportsMatchingMarketsRequest) SetSxbetMarketID ¶
func (g *GetSportsMatchingMarketsRequest) SetSxbetMarketID(sxbetMarketID []*string)
SetSxbetMarketID sets the SxbetMarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
type PlatformMarket ¶
type PlatformMarket struct {
Platform PlatformMarketPlatform `json:"platform" url:"platform"`
// Kalshi event ticker. Present when platform is KALSHI.
EventTicker *string `json:"event_ticker,omitempty" url:"event_ticker,omitempty"`
// Kalshi market tickers. Present when platform is KALSHI.
MarketTickers []string `json:"market_tickers,omitempty" url:"market_tickers,omitempty"`
// Polymarket market slug. Present when platform is POLYMARKET.
MarketSlug *string `json:"market_slug,omitempty" url:"market_slug,omitempty"`
// Polymarket token IDs. Present when platform is POLYMARKET.
TokenIDs []string `json:"token_ids,omitempty" url:"token_ids,omitempty"`
// Source market ID. Present for platforms other than Kalshi and Polymarket.
MarketID *string `json:"market_id,omitempty" url:"market_id,omitempty"`
// Source outcome IDs. Present for platforms that use outcome IDs.
OutcomeIDs []string `json:"outcome_ids,omitempty" url:"outcome_ids,omitempty"`
// contains filtered or unexported fields
}
func (*PlatformMarket) GetEventTicker ¶
func (p *PlatformMarket) GetEventTicker() *string
func (*PlatformMarket) GetExtraProperties ¶
func (p *PlatformMarket) GetExtraProperties() map[string]interface{}
func (*PlatformMarket) GetMarketID ¶
func (p *PlatformMarket) GetMarketID() *string
func (*PlatformMarket) GetMarketSlug ¶
func (p *PlatformMarket) GetMarketSlug() *string
func (*PlatformMarket) GetMarketTickers ¶
func (p *PlatformMarket) GetMarketTickers() []string
func (*PlatformMarket) GetOutcomeIDs ¶
func (p *PlatformMarket) GetOutcomeIDs() []string
func (*PlatformMarket) GetPlatform ¶
func (p *PlatformMarket) GetPlatform() PlatformMarketPlatform
func (*PlatformMarket) GetTokenIDs ¶
func (p *PlatformMarket) GetTokenIDs() []string
func (*PlatformMarket) MarshalJSON ¶
func (p *PlatformMarket) MarshalJSON() ([]byte, error)
func (*PlatformMarket) SetEventTicker ¶
func (p *PlatformMarket) SetEventTicker(eventTicker *string)
SetEventTicker sets the EventTicker field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetMarketID ¶
func (p *PlatformMarket) SetMarketID(marketID *string)
SetMarketID sets the MarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetMarketSlug ¶
func (p *PlatformMarket) SetMarketSlug(marketSlug *string)
SetMarketSlug sets the MarketSlug field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetMarketTickers ¶
func (p *PlatformMarket) SetMarketTickers(marketTickers []string)
SetMarketTickers sets the MarketTickers field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetOutcomeIDs ¶
func (p *PlatformMarket) SetOutcomeIDs(outcomeIDs []string)
SetOutcomeIDs sets the OutcomeIDs field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetPlatform ¶
func (p *PlatformMarket) SetPlatform(platform PlatformMarketPlatform)
SetPlatform sets the Platform field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) SetTokenIDs ¶
func (p *PlatformMarket) SetTokenIDs(tokenIDs []string)
SetTokenIDs sets the TokenIDs field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*PlatformMarket) String ¶
func (p *PlatformMarket) String() string
func (*PlatformMarket) UnmarshalJSON ¶
func (p *PlatformMarket) UnmarshalJSON(data []byte) error
type PlatformMarketPlatform ¶
type PlatformMarketPlatform string
const ( PlatformMarketPlatformKalshi PlatformMarketPlatform = "KALSHI" PlatformMarketPlatformPolymarket PlatformMarketPlatform = "POLYMARKET" PlatformMarketPlatformPredict PlatformMarketPlatform = "PREDICT" PlatformMarketPlatformSxbet PlatformMarketPlatform = "SXBET" )
func NewPlatformMarketPlatformFromString ¶
func NewPlatformMarketPlatformFromString(s string) (PlatformMarketPlatform, error)
func (PlatformMarketPlatform) Ptr ¶
func (p PlatformMarketPlatform) Ptr() *PlatformMarketPlatform
type ServiceUnavailableError ¶
type ServiceUnavailableError struct {
}
Matching markets reader unavailable
func (*ServiceUnavailableError) MarshalJSON ¶
func (s *ServiceUnavailableError) MarshalJSON() ([]byte, error)
func (*ServiceUnavailableError) UnmarshalJSON ¶
func (s *ServiceUnavailableError) UnmarshalJSON(data []byte) error
func (*ServiceUnavailableError) Unwrap ¶
func (s *ServiceUnavailableError) Unwrap() error
type SportsMatchingResponse ¶
type SportsMatchingResponse struct {
// Key-value pairs where each key is the queried identifier (Kalshi event ticker, Polymarket slug, or canonical event ID when no filter is provided) and each value is an array of platform market objects.
Markets map[string][]*PlatformMarket `json:"markets" url:"markets"`
// contains filtered or unexported fields
}
func (*SportsMatchingResponse) GetExtraProperties ¶
func (s *SportsMatchingResponse) GetExtraProperties() map[string]interface{}
func (*SportsMatchingResponse) GetMarkets ¶
func (s *SportsMatchingResponse) GetMarkets() map[string][]*PlatformMarket
func (*SportsMatchingResponse) MarshalJSON ¶
func (s *SportsMatchingResponse) MarshalJSON() ([]byte, error)
func (*SportsMatchingResponse) SetMarkets ¶
func (s *SportsMatchingResponse) SetMarkets(markets map[string][]*PlatformMarket)
SetMarkets sets the Markets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.
func (*SportsMatchingResponse) String ¶
func (s *SportsMatchingResponse) String() string
func (*SportsMatchingResponse) UnmarshalJSON ¶
func (s *SportsMatchingResponse) UnmarshalJSON(data []byte) error
type TooManyRequestsError ¶
type TooManyRequestsError struct {
*core.APIError
Body *ErrorResponse
}
API key exceeded its rate limit or credits
func (*TooManyRequestsError) MarshalJSON ¶
func (t *TooManyRequestsError) MarshalJSON() ([]byte, error)
func (*TooManyRequestsError) UnmarshalJSON ¶
func (t *TooManyRequestsError) UnmarshalJSON(data []byte) error
func (*TooManyRequestsError) Unwrap ¶
func (t *TooManyRequestsError) Unwrap() error
type UnauthorizedError ¶
type UnauthorizedError struct {
}
Missing or invalid API key
func (*UnauthorizedError) MarshalJSON ¶
func (u *UnauthorizedError) MarshalJSON() ([]byte, error)
func (*UnauthorizedError) UnmarshalJSON ¶
func (u *UnauthorizedError) UnmarshalJSON(data []byte) error
func (*UnauthorizedError) Unwrap ¶
func (u *UnauthorizedError) Unwrap() error