api

package
v0.0.0-...-68da6d9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package api provides data structures and helper methods to work with the dashboard JSON API. All structures in this package are backwards compatible.

Index

Constants

View Source
const Version = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Bug

type Bug struct {
	Version     int      `json:"version"`
	Title       string   `json:"title,omitempty"`
	ID          string   `json:"id"`
	FixCommits  []Commit `json:"fix-commits,omitempty"`
	CauseCommit *Commit  `json:"cause-commit,omitempty"`
	// Links to the discussions.
	Discussions []string `json:"discussions,omitempty"`
	Crashes     []Crash  `json:"crashes,omitempty"`
}

type BugGroup

type BugGroup struct {
	Version int `json:"version"`
	Bugs    []BugSummary
}

type BugGroupType

type BugGroupType int
const (
	BugGroupOpen BugGroupType = 1 << iota
	BugGroupFixed
	BugGroupInvalid
	BugGroupAll = ^0
)

type BugSummary

type BugSummary struct {
	Title       string   `json:"title,omitempty"`
	Link        string   `json:"link"`
	LastUpdated string   `json:"last-updated,omitempty"`
	FixCommits  []Commit `json:"fix-commits,omitempty"`
}

type Client

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

func NewClient

func NewClient(dashboardURL, accessToken string) *Client

accessToken is OAuth access token obtained with "gcloud auth print-access-token" (provided your account has at least user level access to the dashboard). If the token is provided, dashboard should disable API throttling. The token can be empty, in which case the dashboard may throttle requests.

func NewTestClient

func NewTestClient(ctor requestCtor, doer requestDoer) *Client

func (*Client) Bug

func (c *Client) Bug(link string) (*Bug, error)

func (*Client) BugGroups

func (c *Client) BugGroups(ns string, groups BugGroupType) ([]BugSummary, error)

func (*Client) Text

func (c *Client) Text(query string) ([]byte, error)

type Commit

type Commit struct {
	Title  string `json:"title"`
	Link   string `json:"link,omitempty"`
	Hash   string `json:"hash,omitempty"`
	Repo   string `json:"repo,omitempty"`
	Branch string `json:"branch,omitempty"`
}

type Crash

type Crash struct {
	Title               string `json:"title"`
	SyzReproducerLink   string `json:"syz-reproducer,omitempty"`
	CReproducerLink     string `json:"c-reproducer,omitempty"`
	KernelConfigLink    string `json:"kernel-config,omitempty"`
	KernelSourceGit     string `json:"kernel-source-git,omitempty"`
	KernelSourceCommit  string `json:"kernel-source-commit,omitempty"`
	SyzkallerGit        string `json:"syzkaller-git,omitempty"`
	SyzkallerCommit     string `json:"syzkaller-commit,omitempty"`
	CompilerDescription string `json:"compiler-description,omitempty"`
	Architecture        string `json:"architecture,omitempty"`
	CrashReportLink     string `json:"crash-report-link,omitempty"`
}

Jump to

Keyboard shortcuts

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