Documentation
¶
Index ¶
- func ReadJSON(resp *http.Response, dest interface{}) error
- type AuthProvider
- type Client
- func (c *Client) CreateReply(parentID, content string) (*ThreadReply, error)
- func (c *Client) DoWithRetry(fn func(token string) (*http.Response, error)) (*http.Response, error)
- func (c *Client) FetchCommentByID(commentID string) (*ReviewComment, error)
- func (c *Client) FetchComments(changeID string) ([]ReviewComment, error)
- func (c *Client) FetchReplies(changeID string) ([]ReviewComment, error)
- func (c *Client) FetchRepliesByParentID(parentID string) ([]ReviewComment, error)
- func (c *Client) FetchResolvedComments(changeID string) ([]ReviewComment, error)
- func (c *Client) Get(token, path string) (*http.Response, error)
- func (c *Client) GetChange(specID string) (*apiChange, error)
- func (c *Client) GetProject(repoOwner, repoName string) (*apiProject, error)
- func (c *Client) GetSpec(projectID, specKey string) (*apiSpec, error)
- func (c *Client) ResolveComment(commentID string) error
- func (c *Client) ResolveCommentWithReplies(commentID string, replyIDs []string) error
- type ReplyMap
- type ReviewComment
- type ThreadReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthProvider ¶ added in v1.0.46
type AuthProvider interface {
LoadCredentials() (*auth.Credentials, error)
ForceRefreshAccessToken() (string, error)
}
AuthProvider abstracts credential operations for testability.
type Client ¶
type Client struct {
BaseURL string
AnonKey string
HTTPClient *http.Client
AuthProvider AuthProvider
// contains filtered or unexported fields
}
func (*Client) CreateReply ¶
func (c *Client) CreateReply(parentID, content string) (*ThreadReply, error)
func (*Client) DoWithRetry ¶
func (*Client) FetchCommentByID ¶
func (c *Client) FetchCommentByID(commentID string) (*ReviewComment, error)
func (*Client) FetchComments ¶
func (c *Client) FetchComments(changeID string) ([]ReviewComment, error)
func (*Client) FetchReplies ¶
func (c *Client) FetchReplies(changeID string) ([]ReviewComment, error)
func (*Client) FetchRepliesByParentID ¶
func (c *Client) FetchRepliesByParentID(parentID string) ([]ReviewComment, error)
func (*Client) FetchResolvedComments ¶
func (c *Client) FetchResolvedComments(changeID string) ([]ReviewComment, error)
func (*Client) GetProject ¶
func (*Client) ResolveComment ¶
type ReplyMap ¶
type ReplyMap map[string][]ReviewComment
func BuildReplyMap ¶
func BuildReplyMap(replies []ReviewComment) ReplyMap
type ReviewComment ¶
type ReviewComment struct {
ID string `json:"id"`
ChangeID string `json:"change_id"`
FilePath string `json:"file_path"`
Content string `json:"content"`
SelectedText string `json:"selected_text"`
Line *int `json:"line"`
StartLine *int `json:"start_line"`
IsResolved bool `json:"is_resolved"`
AuthorID string `json:"author_id"`
AuthorName string `json:"author_name"`
AuthorEmail string `json:"author_email"`
ParentCommentID string `json:"parent_comment_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.