api

package
v0.0.0-...-bf165d5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(url string, name string, onProgress func(ratio float64))

Types

type APIClient

type APIClient struct {
	Server *url.URL
	Client *http.Client
}

func CreateNewAPI

func CreateNewAPI(server *url.URL) *APIClient

func (*APIClient) FetchPlatformTests

func (api *APIClient) FetchPlatformTests(os_id string) (*TestRoot, error)

func (*APIClient) FetchSupportedPlatforms

func (api *APIClient) FetchSupportedPlatforms() ([]Platform, error)

type Platform

type Platform struct {
	Id            string `json:"id"`
	Name          string `json:"name"`
	Type          string `json:"type"`
	Version       string `json:"version"`
	VersionID     string `json:"version_id"`
	DisplayName   string `json:"display_name"`
	ReplacementID string `json:"replacement_id"`
	Supported     bool   `json:"supported"`
	Architecture  string `json:"architecture"`
}

type Platforms

type Platforms struct {
	Platforms []Platform `json:"platforms"`
}

type Test

type Test struct {
	Name         string                `json:"name"`
	SourceURL    string                `json:"source_url"`
	SourceHashes []hardware.HashedFile `json:"source_hashs"`
	TestType     string                `json:"test_type"`
	Data         []TestData            `json:"data"`
}

type TestData

type TestData struct {
	ID             string             `json:"id"`
	FromResolution string             `json:"from_resolution"`
	ToResolution   string             `json:"to_resolution"`
	Bitrate        int                `json:"bitrate"`
	Arguments      []TestDataArgument `json:"arguments"`
}

type TestDataArgument

type TestDataArgument struct {
	Type      string `json:"type"`
	Arguments string `json:"args"`
	Codec     string `json:"codec"`
}

type TestRoot

type TestRoot struct {
	Token  string              `json:"token"`
	FFmpeg hardware.FFmpegInfo `json:"ffmpeg"`
	Tests  []Test              `json:"tests"`
}

Jump to

Keyboard shortcuts

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