client

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChunks

func GetChunks[T any](chunkInfo *IRacingChunkInfo) ([]T, error)

func GetCsv

func GetCsv[T any](c *ApiClient, path string, parameters interface{}) ([]T, error)

func GetJson

func GetJson[T any](c *ApiClient, path string, parameters interface{}) (*T, error)

Types

type ApiClient

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

func NewApiClient

func NewApiClient(accessToken, refreshToken string, options *Options) *ApiClient

func NewPasswordLimitedApiClient

func NewPasswordLimitedApiClient(username, password string, options *Options) (*ApiClient, error)

func (*ApiClient) Get

func (c *ApiClient) Get(path string, parametersData string) (*http.Response, error)

func (*ApiClient) GetResourceUrl

func (c *ApiClient) GetResourceUrl(path string, parametersData string) (string, error)

type IRacingChunkInfo

type IRacingChunkInfo struct {
	ChunkSize       int      `json:"chunk_size"`
	NumChunks       int      `json:"num_chunks"`
	Rows            int      `json:"rows"`
	BaseDownloadUrl string   `json:"base_download_url"`
	ChunkFileNames  []string `json:"chunk_file_names"`
}

type Options

type Options struct {
	Concurrency int

	ClientId     string
	ClientSecret string

	AutoRefreshDisabled bool
}

Jump to

Keyboard shortcuts

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