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

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