Documentation
¶
Overview ¶
Package api provides GitCode API client
Index ¶
- Constants
- Variables
- func BuildURL(base string, params map[string]string) string
- func ClearIssueLabels(client *Client, owner, repo string, number int) error
- func DefaultHTTPClient() *http.Client
- func DeleteIssueComment(client *Client, owner, repo string, commentID int64) error
- func DeleteLabel(client *Client, owner, repo, name string) error
- func DeleteMilestone(client *Client, owner, repo string, number int) error
- func DeleteRelease(client *Client, owner, repo string, id int64) error
- func DeleteReleaseAsset(client *Client, owner, repo string, assetID int64) error
- func DeleteReleaseByTag(client *Client, owner, repo, tag string) error
- func DeleteRepo(client *Client, owner, name string) error
- func GetPRDiff(client *Client, owner, repo string, number int) (string, error)
- func RemoveLabelFromIssue(client *Client, owner, repo string, number int, label string) error
- func UploadReleaseAssetByTag(client *Client, owner, repo, tag, filename string, content []byte, ...) error
- type APIError
- type AssetUploadURL
- type Client
- func (c *Client) Delete(path string) error
- func (c *Client) Get(path string, response interface{}) error
- func (c *Client) Host() string
- func (c *Client) Patch(path string, body interface{}, response interface{}) error
- func (c *Client) Post(path string, body interface{}, response interface{}) error
- func (c *Client) Put(path string, body interface{}, response interface{}) error
- func (c *Client) REST(method, path string, body interface{}, response interface{}) error
- func (c *Client) SetHost(host string)
- func (c *Client) SetToken(token, source string)
- func (c *Client) Token() string
- func (c *Client) UploadAsset(path, filename string, content []byte, contentType string) (*ReleaseAsset, error)
- func (c *Client) UploadToURL(uploadURL, filename string, content []byte, contentType string, ...) error
- type Commit
- type CreateCommentOptions
- type CreateIssueOptions
- type CreateLabelOptions
- type CreateMilestoneOptions
- type CreatePRCommentOptions
- type CreatePROptions
- type CreatePRReviewOptions
- type CreateReleaseOptions
- type CreateRepoOptions
- type Issue
- func CloseIssue(client *Client, owner, repo string, number int) (*Issue, error)
- func CreateIssue(client *Client, owner, repo string, opts *CreateIssueOptions) (*Issue, error)
- func GetIssue(client *Client, owner, repo string, number int) (*Issue, error)
- func ListRepoIssues(client *Client, owner, repo string, opts *IssueListOptions) ([]Issue, error)
- func ReopenIssue(client *Client, owner, repo string, number int) (*Issue, error)
- func UpdateIssue(client *Client, owner, repo string, number int, opts *UpdateIssueOptions) (*Issue, error)
- type IssueComment
- type IssueListOptions
- type Label
- func AddLabelsToIssue(client *Client, owner, repo string, number int, labels []string) ([]Label, error)
- func CreateLabel(client *Client, owner, repo string, opts *CreateLabelOptions) (*Label, error)
- func GetLabel(client *Client, owner, repo, name string) (*Label, error)
- func ListRepoLabels(client *Client, owner, repo string) ([]Label, error)
- func SetIssueLabels(client *Client, owner, repo string, number int, labels []string) ([]Label, error)
- func UpdateLabel(client *Client, owner, repo, name string, opts *UpdateLabelOptions) (*Label, error)
- type MergePROptions
- type Milestone
- func CloseMilestone(client *Client, owner, repo string, number int) (*Milestone, error)
- func CreateMilestone(client *Client, owner, repo string, opts *CreateMilestoneOptions) (*Milestone, error)
- func GetMilestone(client *Client, owner, repo string, number int) (*Milestone, error)
- func ListRepoMilestones(client *Client, owner, repo string) ([]Milestone, error)
- func OpenMilestone(client *Client, owner, repo string, number int) (*Milestone, error)
- func UpdateMilestone(client *Client, owner, repo string, number int, opts *UpdateMilestoneOptions) (*Milestone, error)
- type PRBranch
- type PRComment
- type PRListOptions
- type PRReview
- type PRReviewComment
- type PullRequest
- func ClosePullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
- func CreatePullRequest(client *Client, owner, repo string, opts *CreatePROptions) (*PullRequest, error)
- func GetPullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
- func ListPullRequests(client *Client, owner, repo string, opts *PRListOptions) ([]PullRequest, error)
- func MergePullRequest(client *Client, owner, repo string, number int, opts *MergePROptions) (*PullRequest, error)
- func ReopenPullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
- func UpdatePullRequest(client *Client, owner, repo string, number int, opts *UpdatePROptions) (*PullRequest, error)
- type Release
- func CreateRelease(client *Client, owner, repo string, opts *CreateReleaseOptions) (*Release, error)
- func GetLatestRelease(client *Client, owner, repo string) (*Release, error)
- func GetRelease(client *Client, owner, repo, tag string) (*Release, error)
- func GetReleaseByID(client *Client, owner, repo string, id int64) (*Release, error)
- func ListReleases(client *Client, owner, repo string, opts *ReleaseListOptions) ([]Release, error)
- func UpdateRelease(client *Client, owner, repo string, id int64, opts *UpdateReleaseOptions) (*Release, error)
- func UpdateReleaseByTag(client *Client, owner, repo, tag string, opts *UpdateReleaseOptions) (*Release, error)
- type ReleaseAsset
- func GetReleaseAsset(client *Client, owner, repo string, assetID int64) (*ReleaseAsset, error)
- func ListReleaseAssets(client *Client, owner, repo string, releaseID int64) ([]ReleaseAsset, error)
- func UploadReleaseAsset(client *Client, owner, repo string, releaseID int64, filename string, ...) (*ReleaseAsset, error)
- type ReleaseListOptions
- type RepoListOptions
- type Repository
- func CreateOrgRepo(client *Client, org string, opts *CreateRepoOptions) (*Repository, error)
- func CreateRepo(client *Client, opts *CreateRepoOptions) (*Repository, error)
- func ForkRepo(client *Client, owner, name string) (*Repository, error)
- func GetRepo(client *Client, owner, name string) (*Repository, error)
- func ListUserRepos(client *Client, opts *RepoListOptions) ([]Repository, error)
- type UpdateIssueOptions
- type UpdateLabelOptions
- type UpdateMilestoneOptions
- type UpdatePROptions
- type UpdateReleaseOptions
- type User
Constants ¶
const ( // DefaultHost is the default GitCode host DefaultHost = "api.gitcode.com" // DefaultAPIVersion is the default API version DefaultAPIVersion = "v5" )
Variables ¶
var ErrInvalidReleaseID = fmtError("invalid release ID")
ErrInvalidReleaseID is returned when release ID is invalid
var ErrNoReleaseID = fmtError("release has no ID")
ErrNoReleaseID is returned when release has no ID
Functions ¶
func BuildURL ¶
BuildURL builds a URL with path parameters
func ClearIssueLabels ¶
ClearIssueLabels removes all labels from an issue
func DefaultHTTPClient ¶
DefaultHTTPClient returns the default HTTP client
func DeleteIssueComment ¶
DeleteIssueComment deletes a comment on an issue
func DeleteLabel ¶
DeleteLabel deletes a label
func DeleteMilestone ¶
DeleteMilestone deletes a milestone
func DeleteRelease ¶
DeleteRelease deletes a release by ID
func DeleteReleaseAsset ¶
DeleteReleaseAsset deletes a release asset
func DeleteReleaseByTag ¶
DeleteReleaseByTag deletes a release by tag name
func DeleteRepo ¶
DeleteRepo deletes a repository
func GetPRDiff ¶
GetPRDiff gets the diff of a PR
func RemoveLabelFromIssue ¶
RemoveLabelFromIssue removes a label from an issue
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Message string `json:"message"`
ErrorName string `json:"error"`
}
APIError represents an API error
type AssetUploadURL ¶
AssetUploadURL represents the response from getting upload URL
func GetReleaseUploadURL ¶
func GetReleaseUploadURL(client *Client, owner, repo, tag, filename string) (*AssetUploadURL, error)
GetReleaseUploadURL fetches the upload URL for a release asset
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GitCode API client
func ClientFromToken ¶
ClientFromToken creates a client with the given token
func ClientFromTokenAndHost ¶
ClientFromTokenAndHost creates a client with the given token and host
func NewClient ¶
NewClient creates a new API client
func NewClientFromHTTP ¶
NewClientFromHTTP creates a client from an existing HTTP client
func (*Client) Get ¶
Get performs a GET request
func (*Client) Patch ¶
Patch performs a PATCH request
func (*Client) Post ¶
Post performs a POST request
func (*Client) Put ¶
Put performs a PUT request
func (*Client) REST ¶
REST performs a REST API call
func (*Client) SetToken ¶
SetToken sets the authentication token
type Commit ¶
type Commit struct {
SHA string `json:"sha"`
Message string `json:"message"`
Author *User `json:"author"`
Committer *User `json:"committer"`
}
Commit represents a Git commit
type CreateCommentOptions ¶
type CreateCommentOptions struct {
Body string `json:"body"`
}
CreateCommentOptions represents options for creating a comment
type CreateIssueOptions ¶
type CreateIssueOptions struct {
Title string `json:"title"`
Body string `json:"body,omitempty"`
Assignees []string `json:"assignees,omitempty"`
Labels []string `json:"labels,omitempty"`
Milestone int `json:"milestone,omitempty"`
}
CreateIssueOptions represents options for creating an issue
type CreateLabelOptions ¶
type CreateLabelOptions struct {
Name string `json:"name"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
}
CreateLabelOptions represents options for creating a label
type CreateMilestoneOptions ¶
type CreateMilestoneOptions struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
State string `json:"state,omitempty"`
DueOn *time.Time `json:"due_on,omitempty"`
}
CreateMilestoneOptions represents options for creating a milestone
type CreatePRCommentOptions ¶
type CreatePRCommentOptions struct {
Body string `json:"body"`
Path string `json:"path,omitempty"`
Position int `json:"position,omitempty"`
}
CreatePRCommentOptions represents options for creating a PR comment
type CreatePROptions ¶
type CreatePROptions struct {
Title string `json:"title"`
Body string `json:"body,omitempty"`
Head string `json:"head"`
Base string `json:"base"`
Draft bool `json:"draft,omitempty"`
}
CreatePROptions represents options for creating a PR
type CreatePRReviewOptions ¶
type CreatePRReviewOptions struct {
Body string `json:"body,omitempty"`
Event string `json:"event"`
Comments []PRReviewComment `json:"comments,omitempty"`
}
CreatePRReviewOptions represents options for creating a PR review
type CreateReleaseOptions ¶
type CreateReleaseOptions struct {
TagName string `json:"tag_name"`
Name string `json:"name,omitempty"`
Body string `json:"body,omitempty"`
Draft bool `json:"draft,omitempty"`
Prerelease bool `json:"prerelease,omitempty"`
TargetCommitish string `json:"target_commitish,omitempty"`
}
CreateReleaseOptions represents options for creating a release
type CreateRepoOptions ¶
type CreateRepoOptions struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Private bool `json:"private"`
AutoInit bool `json:"auto_init,omitempty"`
GitignoreTemplate string `json:"gitignore_template,omitempty"`
LicenseTemplate string `json:"license_template,omitempty"`
}
CreateRepoOptions represents options for creating a repository
type Issue ¶
type Issue struct {
ID interface{} `json:"id"`
Number string `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
HTMLURL string `json:"html_url"`
User *User `json:"user"`
Assignees []*User `json:"assignees"`
Labels []*Label `json:"labels"`
Milestone *Milestone `json:"milestone"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at"`
Comments int `json:"comments"`
}
Issue represents a GitCode issue
func CloseIssue ¶
CloseIssue closes an issue
func CreateIssue ¶
func CreateIssue(client *Client, owner, repo string, opts *CreateIssueOptions) (*Issue, error)
CreateIssue creates a new issue
func GetIssue ¶
GetIssue fetches an issue by number
func ListRepoIssues ¶
func ListRepoIssues(client *Client, owner, repo string, opts *IssueListOptions) ([]Issue, error)
ListRepoIssues lists issues for a repository
func ReopenIssue ¶
ReopenIssue reopens a closed issue
type IssueComment ¶
type IssueComment struct {
ID interface{} `json:"id"`
Body string `json:"body"`
User *User `json:"user"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
IssueComment represents a comment on an issue
func CreateIssueComment ¶
func CreateIssueComment(client *Client, owner, repo string, number int, opts *CreateCommentOptions) (*IssueComment, error)
CreateIssueComment creates a comment on an issue
type IssueListOptions ¶
type IssueListOptions struct {
State string `url:"state,omitempty"`
Labels string `url:"labels,omitempty"`
Sort string `url:"sort,omitempty"`
Direction string `url:"direction,omitempty"`
Since string `url:"since,omitempty"`
PerPage int `url:"per_page,omitempty"`
Page int `url:"page,omitempty"`
}
IssueListOptions represents options for listing issues
type Label ¶
type Label struct {
ID interface{} `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Description string `json:"description"`
}
Label represents a GitCode label
func AddLabelsToIssue ¶
func AddLabelsToIssue(client *Client, owner, repo string, number int, labels []string) ([]Label, error)
AddLabelsToIssue adds labels to an issue
func CreateLabel ¶
func CreateLabel(client *Client, owner, repo string, opts *CreateLabelOptions) (*Label, error)
CreateLabel creates a new label in a repository
func GetLabel ¶
GetLabel fetches a label by name
func ListRepoLabels ¶
ListRepoLabels lists labels for a repository
type MergePROptions ¶
type MergePROptions struct {
CommitTitle string `json:"commit_title,omitempty"`
CommitMessage string `json:"commit_message,omitempty"`
SHA string `json:"sha,omitempty"`
MergeMethod string `json:"merge_method,omitempty"`
}
MergePROptions represents options for merging a PR
type Milestone ¶
type Milestone struct {
ID interface{} `json:"id"`
Number string `json:"number"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"`
DueOn *time.Time `json:"due_on"`
}
Milestone represents a GitCode milestone
func CloseMilestone ¶
CloseMilestone closes a milestone
func CreateMilestone ¶
func CreateMilestone(client *Client, owner, repo string, opts *CreateMilestoneOptions) (*Milestone, error)
CreateMilestone creates a new milestone
func GetMilestone ¶
GetMilestone fetches a milestone by number
func ListRepoMilestones ¶
ListRepoMilestones lists milestones for a repository
func OpenMilestone ¶
OpenMilestone reopens a milestone
type PRBranch ¶
type PRBranch struct {
Label string `json:"label"`
Ref string `json:"ref"`
SHA string `json:"sha"`
Repo *Repository `json:"repo"`
}
PRBranch represents a branch in a PR
type PRComment ¶
type PRComment struct {
ID interface{} `json:"id"`
Body string `json:"body"`
User *User `json:"user"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Path string `json:"path"`
Position int `json:"position"`
}
PRComment represents a comment on a PR
type PRListOptions ¶
type PRListOptions struct {
State string `url:"state,omitempty"`
Head string `url:"head,omitempty"`
Base string `url:"base,omitempty"`
Sort string `url:"sort,omitempty"`
Direction string `url:"direction,omitempty"`
PerPage int `url:"per_page,omitempty"`
Page int `url:"page,omitempty"`
}
PRListOptions represents options for listing PRs
type PRReview ¶
type PRReview struct {
ID interface{} `json:"id"`
User *User `json:"user"`
Body string `json:"body"`
State string `json:"state"`
SubmittedAt time.Time `json:"submitted_at"`
}
PRReview represents a review on a PR
type PRReviewComment ¶
type PRReviewComment struct {
Path string `json:"path"`
Position int `json:"position"`
Body string `json:"body"`
}
PRReviewComment represents a comment in a review
type PullRequest ¶
type PullRequest struct {
ID interface{} `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
User *User `json:"user"`
Head *PRBranch `json:"head"`
Base *PRBranch `json:"base"`
Merged bool `json:"merged"`
MergedAt *string `json:"merged_at"`
Mergeable *bool `json:"mergeable"`
MergeState interface{} `json:"mergeable_state"`
Draft bool `json:"draft"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *string `json:"closed_at"`
Comments int `json:"comments"`
Commits int `json:"commits"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
Labels []*Label `json:"labels"`
Assignees []*User `json:"assignees"`
Reviewers []*User `json:"requested_reviewers"`
}
PullRequest represents a GitCode pull request
func ClosePullRequest ¶
func ClosePullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
ClosePullRequest closes a PR
func CreatePullRequest ¶
func CreatePullRequest(client *Client, owner, repo string, opts *CreatePROptions) (*PullRequest, error)
CreatePullRequest creates a new PR
func GetPullRequest ¶
func GetPullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
GetPullRequest fetches a PR by number
func ListPullRequests ¶
func ListPullRequests(client *Client, owner, repo string, opts *PRListOptions) ([]PullRequest, error)
ListPullRequests lists pull requests for a repository
func MergePullRequest ¶
func MergePullRequest(client *Client, owner, repo string, number int, opts *MergePROptions) (*PullRequest, error)
MergePullRequest merges a PR
func ReopenPullRequest ¶
func ReopenPullRequest(client *Client, owner, repo string, number int) (*PullRequest, error)
ReopenPullRequest reopens a closed PR
func UpdatePullRequest ¶
func UpdatePullRequest(client *Client, owner, repo string, number int, opts *UpdatePROptions) (*PullRequest, error)
UpdatePullRequest updates an existing PR
type Release ¶
type Release struct {
ID interface{} `json:"id"`
TagName string `json:"tag_name"`
TargetCommitish string `json:"target_commitish"`
Name string `json:"name"`
Body string `json:"body"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
HTMLURL string `json:"html_url"`
AssetsURL string `json:"assets_url"`
UploadURL string `json:"upload_url"`
CreatedAt time.Time `json:"created_at"`
PublishedAt *time.Time `json:"published_at"`
Author *User `json:"author"`
Assets []ReleaseAsset `json:"assets"`
}
Release represents a GitCode release
func CreateRelease ¶
func CreateRelease(client *Client, owner, repo string, opts *CreateReleaseOptions) (*Release, error)
CreateRelease creates a new release
func GetLatestRelease ¶
GetLatestRelease fetches the latest release for a repository
func GetRelease ¶
GetRelease fetches a release by tag name
func GetReleaseByID ¶
GetReleaseByID fetches a release by ID
func ListReleases ¶
func ListReleases(client *Client, owner, repo string, opts *ReleaseListOptions) ([]Release, error)
ListReleases lists releases for a repository
func UpdateRelease ¶
func UpdateRelease(client *Client, owner, repo string, id int64, opts *UpdateReleaseOptions) (*Release, error)
UpdateRelease updates an existing release by ID
type ReleaseAsset ¶
type ReleaseAsset struct {
ID int `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
State string `json:"state"`
ContentType string `json:"content_type"`
Size int `json:"size"`
Downloads int `json:"download_count"`
URL string `json:"url"`
BrowserDownloadURL string `json:"browser_download_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ReleaseAsset represents an asset in a release
func GetReleaseAsset ¶
func GetReleaseAsset(client *Client, owner, repo string, assetID int64) (*ReleaseAsset, error)
GetReleaseAsset fetches a single release asset
type ReleaseListOptions ¶
type ReleaseListOptions struct {
PerPage int `url:"per_page,omitempty"`
Page int `url:"page,omitempty"`
}
ReleaseListOptions represents options for listing releases
type RepoListOptions ¶
type RepoListOptions struct {
Visibility string `url:"visibility,omitempty"`
Affiliation string `url:"affiliation,omitempty"`
Type string `url:"type,omitempty"`
Sort string `url:"sort,omitempty"`
Direction string `url:"direction,omitempty"`
PerPage int `url:"per_page,omitempty"`
Page int `url:"page,omitempty"`
}
RepoListOptions represents options for listing repositories
type Repository ¶
type Repository struct {
ID interface{} `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
Private bool `json:"private"`
Owner *User `json:"owner"`
HTMLURL string `json:"html_url"`
CloneURL string `json:"clone_url"`
SSHURL string `json:"ssh_url"`
DefaultBranch string `json:"default_branch"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
StargazersCount int `json:"stargazers_count"`
ForksCount int `json:"forks_count"`
OpenIssuesCount int `json:"open_issues_count"`
Language string `json:"language"`
}
Repository represents a GitCode repository
func CreateOrgRepo ¶
func CreateOrgRepo(client *Client, org string, opts *CreateRepoOptions) (*Repository, error)
CreateOrgRepo creates a new repository in an organization
func CreateRepo ¶
func CreateRepo(client *Client, opts *CreateRepoOptions) (*Repository, error)
CreateRepo creates a new repository for the authenticated user
func ForkRepo ¶
func ForkRepo(client *Client, owner, name string) (*Repository, error)
ForkRepo forks a repository
func GetRepo ¶
func GetRepo(client *Client, owner, name string) (*Repository, error)
GetRepo fetches a repository by owner/name
func ListUserRepos ¶
func ListUserRepos(client *Client, opts *RepoListOptions) ([]Repository, error)
ListUserRepos lists repositories for the authenticated user
type UpdateIssueOptions ¶
type UpdateIssueOptions struct {
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
State string `json:"state,omitempty"`
StateEvent string `json:"state_event,omitempty"`
Assignees []string `json:"assignees,omitempty"`
Labels []string `json:"labels,omitempty"`
Milestone int `json:"milestone,omitempty"`
}
UpdateIssueOptions represents options for updating an issue
type UpdateLabelOptions ¶
type UpdateLabelOptions struct {
NewName string `json:"new_name,omitempty"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
}
UpdateLabelOptions represents options for updating a label
type UpdateMilestoneOptions ¶
type UpdateMilestoneOptions struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
State string `json:"state,omitempty"`
DueOn *time.Time `json:"due_on,omitempty"`
}
UpdateMilestoneOptions represents options for updating a milestone
type UpdatePROptions ¶
type UpdatePROptions struct {
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
State string `json:"state,omitempty"`
StateEvent string `json:"state_event,omitempty"`
Base string `json:"base,omitempty"`
Draft *bool `json:"draft,omitempty"`
}
UpdatePROptions represents options for updating a PR
type UpdateReleaseOptions ¶
type UpdateReleaseOptions struct {
TagName string `json:"tag_name,omitempty"`
TargetCommitish string `json:"target_commitish,omitempty"`
Name string `json:"name,omitempty"`
Body string `json:"body,omitempty"`
Draft *bool `json:"draft,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
}
UpdateReleaseOptions represents options for updating a release
type User ¶
type User struct {
ID interface{} `json:"id"`
Login string `json:"login"`
Name string `json:"name"`
Email string `json:"email"`
AvatarURL string `json:"avatar_url"`
HTMLURL string `json:"html_url"`
CreatedAt string `json:"created_at"`
}
User represents a GitCode user
func CurrentUser ¶
CurrentUser fetches the current authenticated user
func GetUser ¶
GetUser fetches a user by username
func VerifyToken ¶
VerifyToken verifies that a token is valid by fetching the current user
Source Files
¶
- client.go
- queries_issue.go
- queries_label_milestone.go
- queries_pr.go
- queries_release.go
- queries_repo.go
- queries_user.go