githubapi

package
v1.232.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package githubapi contains the GitHub data shared by Mage reporting targets.

Index

Constants

View Source
const (
	PageSize  = 100
	PageLimit = 100
)

Variables

View Source
var (
	RepoPattern = regexp.MustCompile(`^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$`)
	SHAPattern  = regexp.MustCompile(`^[0-9a-f]{40}$`)
)
View Source
var CommentRunPattern = regexp.MustCompile(`<!-- atmos-benchmark-run:(\d+):(\d+) -->`)

Functions

func Get

func Get(ctx context.Context, client API, path string, response any) error

func NotFound

func NotFound(err error) bool

Types

type API

type API interface {
	DoWithContext(context.Context, string, string, io.Reader, interface{}) error
	RequestWithContext(context.Context, string, string, io.Reader) (*http.Response, error)
}

type Comment

type Comment struct {
	ID   int64  `json:"id"`
	Body string `json:"body"`
	User struct {
		Login string `json:"login"`
		Type  string `json:"type"`
	} `json:"user"`
}

type PR

type PR struct {
	MergeSHA     string `json:"merge_commit_sha"`
	ChangedFiles *int   `json:"changed_files"`
	Draft        bool   `json:"draft"`
	Number       int    `json:"number"`
	State        string `json:"state"`
	Head         struct {
		SHA  string `json:"sha"`
		Repo struct {
			FullName string `json:"full_name"`
		} `json:"repo"`
	} `json:"head"`
	Base struct {
		Ref  string `json:"ref"`
		SHA  string `json:"sha"`
		Repo struct {
			FullName string `json:"full_name"`
		} `json:"repo"`
	} `json:"base"`
}

type Run

type Run struct {
	ID             int64     `json:"id"`
	Attempt        int       `json:"run_attempt"`
	HeadSHA        string    `json:"head_sha"`
	Branch         string    `json:"head_branch"`
	Event          string    `json:"event"`
	Status         string    `json:"status"`
	Conclusion     string    `json:"conclusion"`
	Path           string    `json:"path"`
	Created        time.Time `json:"created_at"`
	Updated        time.Time `json:"updated_at"`
	HeadRepository struct {
		FullName string `json:"full_name"`
	} `json:"head_repository"`
	PullRequests []struct {
		Number int `json:"number"`
	} `json:"pull_requests"`
}

Jump to

Keyboard shortcuts

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