Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AddPullRequestComment(ctx context.Context, owner string, name string, number int, content string) error
- func (c *Client) AddReviewComment(ctx context.Context, owner, name string, number int, content string) (int64, error)
- func (c *Client) ClosePullRequest(ctx context.Context, owner string, name string, number int) error
- func (c *Client) CreateAndPushCommit(ctx context.Context, owner string, name string, branch string, message string, ...) error
- func (c *Client) CreateBranch(ctx context.Context, owner string, name string, branch string) error
- func (c *Client) CreatePullRequest(ctx context.Context, owner string, name string, subject string, ...) (int, error)
- func (c *Client) CreateRepository(ctx context.Context, owner string, name string, options map[string]string) (*Repository, error)
- func (c *Client) CreateSecretInRepository(ctx context.Context, owner string, name string, secretName string, ...) error
- func (c *Client) DeleteBranch(ctx context.Context, owner string, name string, branch string) error
- func (c *Client) GetCurrentUser(ctx context.Context) string
- func (c *Client) GetOwner(ctx context.Context, organizationName string) string
- func (c *Client) GetRepository(ctx context.Context, owner string, name string) (*Repository, error)
- func (c *Client) ListRepositories(ctx context.Context, owner string, filter string) ([]Repository, error)
- func (c *Client) MergePullRequest(ctx context.Context, owner string, name string, number int)
- func (c *Client) Publish(ctx context.Context, owner string, name string, branchName string, path string, ...) error
- func (c *Client) SubmitReview(ctx context.Context, owner string, name string, number int, content string) error
- type ClientOptions
- type Repository
Constants ¶
View Source
const (
GITHUB_TOEKN_ENV_VAR = "GITHUB_TOKEN"
)
Variables ¶
View Source
var ErrGithubClientInitFailed = errors.New("failed to init github client")
View Source
var ErrGithubTokenNotFound = errors.New("github token is not found, unable to init github client")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client github client
func NewClient ¶
func NewClient(options *ClientOptions, logger *logr.Logger) *Client
NewClient create github client, init if not exist
func (*Client) AddPullRequestComment ¶
func (c *Client) AddPullRequestComment(ctx context.Context, owner string, name string, number int, content string) error
AddPullRequestComment add comment to pull request
func (*Client) AddReviewComment ¶
func (c *Client) AddReviewComment(ctx context.Context, owner, name string, number int, content string) (int64, error)
AddReviewComment add review comment
func (*Client) ClosePullRequest ¶
ClosePullRequest close pull request
func (*Client) CreateAndPushCommit ¶
func (c *Client) CreateAndPushCommit(ctx context.Context, owner string, name string, branch string, message string, contents map[string]string) error
CreateAndPushCommit create a commit with files (tree) to a ref(branch)
func (*Client) CreateBranch ¶
CreateBranch create a branch
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(ctx context.Context, owner string, name string, subject string, description string, baseBranch string, headBranch string) (int, error)
CreatePullRequest create pull request
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(ctx context.Context, owner string, name string, options map[string]string) (*Repository, error)
CreateRepository create repository
func (*Client) CreateSecretInRepository ¶ added in v0.0.12
func (*Client) DeleteBranch ¶
DeleteBranch delete a branch TODO support delete branch
func (*Client) GetRepository ¶
GetRepository get repository by name
func (*Client) ListRepositories ¶
func (c *Client) ListRepositories(ctx context.Context, owner string, filter string) ([]Repository, error)
ListRepositories list repository
func (*Client) MergePullRequest ¶
MergePullRequest merge pull request
type ClientOptions ¶
Click to show internal directories.
Click to hide internal directories.