api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cookie string, timeout time.Duration, options ...ClientOption) *Client

func (*Client) SearchGames

func (c *Client) SearchGames(ctx context.Context, query Query) (json.RawMessage, error)

func (*Client) SearchGeneral

func (c *Client) SearchGeneral(ctx context.Context, query Query) (json.RawMessage, error)

func (*Client) SearchTopics

func (c *Client) SearchTopics(ctx context.Context, query Query) (json.RawMessage, error)

type ClientOption

type ClientOption func(*Client)

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

func WithClock

func WithClock(clock func() time.Time) ClientOption

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

type Error

type Error struct {
	Kind       ErrorKind
	Message    string
	StatusCode int
	Cause      error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorKind

type ErrorKind string
const (
	ErrorAuth         ErrorKind = "auth"
	ErrorCaptcha      ErrorKind = "captcha"
	ErrorRateLimit    ErrorKind = "rate_limit"
	ErrorNetwork      ErrorKind = "network"
	ErrorUpstream     ErrorKind = "upstream"
	ErrorIncompatible ErrorKind = "incompatible"
)

func Kind

func Kind(err error) ErrorKind

type Query

type Query struct {
	Keyword string
	Type    string
	Sort    string
	Offset  int
	Limit   int
}

type Response

type Response struct {
	Status string          `json:"status"`
	Msg    string          `json:"msg"`
	Result json.RawMessage `json:"result"`
}

Jump to

Keyboard shortcuts

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