github

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, param *ParamNew) (*Client, error)

func (*Client) CreateComment

func (client *Client) CreateComment(ctx context.Context, cmt *Comment) error

func (*Client) GetAuthenticatedUser

func (client *Client) GetAuthenticatedUser(ctx context.Context) (string, error)

func (*Client) HideComment

func (client *Client) HideComment(ctx context.Context, nodeID string) error

func (*Client) ListComments

func (client *Client) ListComments(ctx context.Context, pr *PullRequest) ([]*IssueComment, error)

func (*Client) PRNumberWithSHA

func (client *Client) PRNumberWithSHA(ctx context.Context, owner, repo, sha string) (int, error)

type Comment

type Comment struct {
	PRNumber       int
	CommentID      int64
	Org            string
	Repo           string
	Body           string
	BodyForTooLong string
	SHA1           string
	HideOldComment string
	TemplateKey    string
	Vars           map[string]interface{}
}

type IssueComment

type IssueComment struct {
	ID         string
	DatabaseID int64
	Body       string
	Author     struct {
		Login string
	}
	CreatedAt string
	// TODO remove
	IsMinimized       bool
	ViewerCanMinimize bool
}

`graphql:"IssueComment(isMinimized: false, viewerCanMinimize: true)"`

type IssuesService

type IssuesService interface {
	CreateComment(ctx context.Context, owner string, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
	EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
}

type Mock

type Mock struct {
	Stderr   io.Writer
	Silent   bool
	Login    string
	PRNumber int
}

func (*Mock) CreateComment

func (mock *Mock) CreateComment(ctx context.Context, cmt *Comment) error

func (*Mock) GetAuthenticatedUser

func (mock *Mock) GetAuthenticatedUser(ctx context.Context) (string, error)

func (*Mock) HideComment

func (mock *Mock) HideComment(ctx context.Context, nodeID string) error

func (*Mock) ListComments

func (mock *Mock) ListComments(ctx context.Context, pr *PullRequest) ([]*IssueComment, error)

func (*Mock) PRNumberWithSHA

func (mock *Mock) PRNumberWithSHA(ctx context.Context, owner, repo, sha string) (int, error)

type ParamNew

type ParamNew struct {
	Token              string
	GHEBaseURL         string
	GHEGraphQLEndpoint string
}

type PullRequest

type PullRequest struct {
	PRNumber int
	Org      string
	Repo     string
}

type PullRequestsService

type PullRequestsService interface {
	ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
}

type RepositoriesService

type RepositoriesService interface {
	CreateComment(ctx context.Context, owner, repo, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *github.Response, error)
	UpdateComment(ctx context.Context, owner, repo string, id int64, comment *github.RepositoryComment) (*github.RepositoryComment, *github.Response, error)
}

type UsersService

type UsersService interface {
	Get(ctx context.Context, user string) (*github.User, *github.Response, error)
}

type V4Client

type V4Client interface {
	Mutate(ctx context.Context, m interface{}, input githubv4.Input, variables map[string]interface{}) error
	Query(ctx context.Context, q interface{}, variables map[string]interface{}) error
}

Jump to

Keyboard shortcuts

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