Documentation
¶
Index ¶
- func DecodeResponse(resp *http.Response, v interface{}) error
- func ReadRawBody(resp *http.Response) (string, error)
- type Branch
- type Client
- type Comment
- type Commit
- type Content
- type CreatePRRequest
- type HTTPClient
- func (c *HTTPClient) Delete(ctx context.Context, path string) (*http.Response, error)
- func (c *HTTPClient) Get(ctx context.Context, path string, query url.Values) (*http.Response, error)
- func (c *HTTPClient) Post(ctx context.Context, path string, body interface{}) (*http.Response, error)
- func (c *HTTPClient) Put(ctx context.Context, path string, body interface{}) (*http.Response, error)
- type Inline
- type Link
- type Links
- type ListPRsOpts
- type MergeOpts
- type PR
- type PRService
- func (s *PRService) AddComment(ctx context.Context, id int, body string) (*Comment, error)
- func (s *PRService) Approve(ctx context.Context, id int) error
- func (s *PRService) Create(ctx context.Context, req CreatePRRequest) (*PR, error)
- func (s *PRService) Decline(ctx context.Context, id int) (*PR, error)
- func (s *PRService) Diff(ctx context.Context, id int) (string, error)
- func (s *PRService) Get(ctx context.Context, id int) (*PR, error)
- func (s *PRService) List(ctx context.Context, opts ListPRsOpts) (*Paginated[PR], error)
- func (s *PRService) ListComments(ctx context.Context, id int) (*Paginated[Comment], error)
- func (s *PRService) Merge(ctx context.Context, id int, opts MergeOpts) (*PR, error)
- func (s *PRService) Unapprove(ctx context.Context, id int) error
- type Paginated
- type Participant
- type RawResponse
- type Ref
- type Repository
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
Types ¶
type Client ¶
type Client interface {
Get(ctx context.Context, path string, query url.Values) (*http.Response, error)
Post(ctx context.Context, path string, body interface{}) (*http.Response, error)
Put(ctx context.Context, path string, body interface{}) (*http.Response, error)
Delete(ctx context.Context, path string) (*http.Response, error)
}
type CreatePRRequest ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(authProvider auth.Provider) *HTTPClient
type ListPRsOpts ¶
type PR ¶
type PR struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"`
Author User `json:"author"`
Source Ref `json:"source"`
Destination Ref `json:"destination"`
CloseSourceBranch bool `json:"close_source_branch"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
MergeCommit *Commit `json:"merge_commit,omitempty"`
CommentCount int `json:"comment_count"`
TaskCount int `json:"task_count"`
Reviewers []User `json:"reviewers"`
Participants []Participant `json:"participants"`
Links Links `json:"links"`
}
type PRService ¶
type PRService struct {
// contains filtered or unexported fields
}
func NewPRService ¶
func (*PRService) AddComment ¶
func (*PRService) ListComments ¶
type Participant ¶
type RawResponse ¶ added in v0.2.0
type Ref ¶
type Ref struct {
Branch Branch `json:"branch"`
Repository Repository `json:"repository"`
}
type Repository ¶
Click to show internal directories.
Click to hide internal directories.