github

package
v6.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 9 Imported by: 0

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 (c *Client) CreateComment(ctx context.Context, cmt *Comment) error

func (*Client) GetAuthenticatedUser

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

func (*Client) HideComment

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

func (*Client) ListComments

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

func (*Client) PRNumberWithSHA

func (c *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
	TemplateKey    string
	Vars           map[string]any
}

type IssueComment

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

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 (m *Mock) CreateComment(ctx context.Context, cmt *Comment) error

func (*Mock) GetAuthenticatedUser

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

func (*Mock) HideComment

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

func (*Mock) ListComments

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

func (*Mock) PRNumberWithSHA

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

type ParamNew

type ParamNew struct {
	Token              string
	GHEBaseURL         string
	GHEGraphQLEndpoint string
	Logger             *slog.Logger
}

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.ListOptions) ([]*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 any, input githubv4.Input, variables map[string]any) error
	Query(ctx context.Context, q any, variables map[string]any) error
}

Jump to

Keyboard shortcuts

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