api

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DiffSideLeft  = "LEFT"
	DiffSideRight = "RIGHT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Host string
	// contains filtered or unexported fields
}

func New

func New() API

func (*API) FetchPR

func (a *API) FetchPR(prURL string) (PRQuery, error)

func (*API) FetchPRDiff

func (a *API) FetchPRDiff(prURL string) (string, error)

type HTTPLogger

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

func NewHTTPLogger

func NewHTTPLogger(limit int) HTTPLogger

NewHTTPLogger creates a new HTTPLogger. If limit is 0 the limit is 100000.

func (*HTTPLogger) Write

func (logger *HTTPLogger) Write(p []byte) (n int, err error)

type PR

type PR struct {
	Title      string
	Number     int
	Url        string
	Repository struct {
		NameWithOwner string
	}
	Merged        bool
	IsDraft       bool
	Closed        bool
	HeadRefName   string
	ReviewThreads struct {
		Nodes []ReviewThread
	} `graphql:"reviewThreads(first: 10)"`
}

type PRQuery

type PRQuery struct {
	Resource struct {
		PullRequest PR `graphql:"... on PullRequest"`
	} `graphql:"resource(url: $url)"`
}

type ReviewThread

type ReviewThread struct {
	Id           string
	IsResolved   bool
	IsOutdated   bool
	Path         string
	Line         int
	OriginalLine int
	DiffSide     string
	Comments     struct {
		Nodes []ReviewThreadComment
	} `graphql:"comments(first: 100)"`
}

type ReviewThreadComment

type ReviewThreadComment struct {
	Id        string
	Body      string
	Author    struct{ Login string }
	CreatedAt time.Time
	Url       string
	ReplyTo   struct{ Id string }
}

Jump to

Keyboard shortcuts

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