Documentation ¶
Overview ¶
client provides API client for backlog.com.
Index ¶
- Constants
- type Client
- func (c *Client) AddIssue(issue *Issue, notifiedUsers []*User) (*Issue, error)
- func (c *Client) AddIssueContext(ctx context.Context, issue *Issue, notifiedUsers []*User) (*Issue, error)
- func (c *Client) AddPullRequest(pullRequest *PullRequest, notifiedUsers []*User) (*PullRequest, error)
- func (c *Client) AddPullRequestContext(ctx context.Context, pullRequest *PullRequest, notifiedUsers []*User) (*PullRequest, error)
- func (c *Client) AddWiki(wiki *Wiki, mailNotify bool) (*Wiki, error)
- func (c *Client) AddWikiAttachments(wikiId uint64, filepaths ...string) ([]*Attachment, error)
- func (c *Client) AddWikiAttachmentsContext(ctx context.Context, wikiId uint64, filepaths ...string) ([]*Attachment, error)
- func (c *Client) AddWikiContext(ctx context.Context, wiki *Wiki, mailNotify bool) (*Wiki, error)
- func (c *Client) DeleteIssue(issueKeyOrId string) (*Issue, error)
- func (c *Client) DeleteIssueContext(ctx context.Context, issueKeyOrId string) (*Issue, error)
- func (c *Client) DeleteWiki(wikiId uint64) (*Wiki, error)
- func (c *Client) DeleteWikiAttachment(wikiId, attachmentId uint64) (*Attachment, error)
- func (c *Client) DeleteWikiAttachmentContext(ctx context.Context, wikiId, attachmentId uint64) (*Attachment, error)
- func (c *Client) DeleteWikiContext(ctx context.Context, wikiId uint64) (*Wiki, error)
- func (c *Client) DownloadWikiAttachment(wikiId, attachmentId uint64) (data []byte, filename string, err error)
- func (c *Client) DownloadWikiAttachmentContext(ctx context.Context, wikiId, attachmentId uint64) (data []byte, filename string, err error)
- func (c *Client) GetAllIssues(maxIssues int, query url.Values) ([]*Issue, error)
- func (c *Client) GetAllIssuesContext(ctx context.Context, maxIssues int, query url.Values) ([]*Issue, error)
- func (c *Client) GetAllPullRequests(projectIdOrKey, repositoryIdOrName string) ([]*PullRequest, error)
- func (c *Client) GetAllPullRequestsContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string) ([]*PullRequest, error)
- func (c *Client) GetIssue(issueKeyOrId string) (*Issue, error)
- func (c *Client) GetIssueComments(issueIdOrKey string, query url.Values) ([]*Comment, error)
- func (c *Client) GetIssueCommentsContext(ctx context.Context, issueIdOrKey string, query url.Values) ([]*Comment, error)
- func (c *Client) GetIssueContext(ctx context.Context, issueKeyOrId string) (*Issue, error)
- func (c *Client) GetIssueTypes(projectIdOrKey string) ([]*IssueType, error)
- func (c *Client) GetIssueTypesContext(ctx context.Context, projectIdOrKey string) ([]*IssueType, error)
- func (c *Client) GetIssues(query url.Values) ([]*Issue, error)
- func (c *Client) GetIssuesContext(ctx context.Context, query url.Values) ([]*Issue, error)
- func (c *Client) GetIssuesCount(query url.Values) (int64, error)
- func (c *Client) GetIssuesCountContext(ctx context.Context, query url.Values) (int64, error)
- func (c *Client) GetMyself() (*User, error)
- func (c *Client) GetMyselfContext(ctx context.Context) (*User, error)
- func (c *Client) GetNotifications(query url.Values) ([]*Notification, error)
- func (c *Client) GetNotificationsContext(ctx context.Context, query url.Values) ([]*Notification, error)
- func (c *Client) GetPriorities() ([]*Priority, error)
- func (c *Client) GetPrioritiesContext(ctx context.Context) ([]*Priority, error)
- func (c *Client) GetProject(projectKeyOrId string) (*Project, error)
- func (c *Client) GetProjectContext(ctx context.Context, projectKeyOrId string) (*Project, error)
- func (c *Client) GetProjectStatuses(projectIdOrKey string) ([]*ProjectStatus, error)
- func (c *Client) GetProjectStatusesContext(ctx context.Context, projectIdOrKey string) ([]*ProjectStatus, error)
- func (c *Client) GetProjects(query url.Values) ([]*Project, error)
- func (c *Client) GetProjectsContext(ctx context.Context, query url.Values) ([]*Project, error)
- func (c *Client) GetPullRequest(projectIdOrKey, repositoryIdOrName string, number int64) (*PullRequest, error)
- func (c *Client) GetPullRequestComments(projectKeyOrId, repositoryNameOrId string, number int64, query url.Values) ([]*Comment, error)
- func (c *Client) GetPullRequestCommentsContext(ctx context.Context, projectKeyOrId, repositoryNameOrId string, number int64, ...) ([]*Comment, error)
- func (c *Client) GetPullRequestContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string, number int64) (*PullRequest, error)
- func (c *Client) GetPullRequests(projectIdOrKey, repositoryIdOrName string, query url.Values) ([]*PullRequest, error)
- func (c *Client) GetPullRequestsContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string, ...) ([]*PullRequest, error)
- func (c *Client) GetPullRequestsCount(projectIdOrKey, repositoryIdOrName string) (int64, error)
- func (c *Client) GetPullRequestsCountContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string) (int64, error)
- func (c *Client) GetRepositories(projectKeyOrId string, query url.Values) ([]*Repository, error)
- func (c *Client) GetRepositoriesContext(ctx context.Context, projectKeyOrId string, query url.Values) ([]*Repository, error)
- func (c *Client) GetRepository(projectKeyOrId, repositoryNameOrId string) (*Repository, error)
- func (c *Client) GetRepositoryContext(ctx context.Context, projectKeyOrId, repositoryNameOrId string) (*Repository, error)
- func (c *Client) GetSpace() (*Space, error)
- func (c *Client) GetSpaceContext(ctx context.Context) (*Space, error)
- func (c *Client) GetSpaceDiskUsage() (*TotalDiskUsage, error)
- func (c *Client) GetSpaceDiskUsageContext(ctx context.Context) (*TotalDiskUsage, error)
- func (c *Client) GetUsers() ([]*User, error)
- func (c *Client) GetUsersContext(ctx context.Context) ([]*User, error)
- func (c *Client) GetWiki(wikiId uint64) (*Wiki, error)
- func (c *Client) GetWikiAttachments(wikiId uint64) ([]*Attachment, error)
- func (c *Client) GetWikiAttachmentsContext(ctx context.Context, wikiId uint64) ([]*Attachment, error)
- func (c *Client) GetWikiContext(ctx context.Context, wikiId uint64) (*Wiki, error)
- func (c *Client) GetWikiCount(projectIdOrKey string) (int, error)
- func (c *Client) GetWikiCountContext(ctx context.Context, projectIdOrKey string) (int, error)
- func (c *Client) GetWikiTags(projectIdOrKey string) ([]*Tag, error)
- func (c *Client) GetWikiTagsContext(ctx context.Context, projectIdOrKey string) ([]*Tag, error)
- func (c *Client) GetWikis(projectIdOrKey string, query url.Values) ([]*Wiki, error)
- func (c *Client) GetWikisContext(ctx context.Context, projectIdOrKey string, query url.Values) ([]*Wiki, error)
- func (c *Client) PostAttachment(filepath string) (*Attachment, error)
- func (c *Client) PostAttachmentContext(ctx context.Context, filepath string) (*Attachment, error)
- func (c *Client) UpdateIssue(issue *Issue, notifiedUsers []*User, comment string) (*Issue, error)
- func (c *Client) UpdateIssueContext(ctx context.Context, issue *Issue, notifiedUsers []*User, comment string) (*Issue, error)
- func (c *Client) UpdatePullRequest(pullRequest *PullRequest, notifiedUsers []*User, comment string) (*PullRequest, error)
- func (c *Client) UpdatePullRequestContext(ctx context.Context, pullRequest *PullRequest, notifiedUsers []*User, ...) (*PullRequest, error)
- func (c *Client) UpdateWiki(wiki *Wiki, mailNotify bool) (*Wiki, error)
- func (c *Client) UpdateWikiContext(ctx context.Context, wiki *Wiki, mailNotify bool) (*Wiki, error)
- type OptionFunc
Constants ¶
const ( V2IssuesCountPath = "/api/v2/issues/count" V2IssuesPath = "/api/v2/issues" V2NotificationsPath = "/api/v2/notifications" V2PrioritiesPath = "/api/v2/priorities" V2ProjectsPath = "/api/v2/projects" V2SpaceActivitiesPath = "/api/v2/space/activities" V2SpaceAttachmentPath = "/api/v2/space/attachment" V2SpaceDiskUsagePath = "/api/v2/space/diskUsage" V2SpaceImagePath = "/api/v2/space/image" V2SpaceNotificationPath = "/api/v2/space/notification" V2SpacePath = "/api/v2/space" V2UsersPath = "/api/v2/users" V2WikisPath = "/api/v2/wikis" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides API access.
func New ¶ added in v0.1.0
func New(space, token string, opts ...OptionFunc) (*Client, error)
New returns API client.
Note: space is your backlog address.
// OK client, _ := client.New("example.backlog.com", "xxxxxxxx")
// OK client, _ := client.New("https://example.backlog.com", "xxxxxxxx")
func (*Client) AddIssue ¶
AddIssue adds new issue.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/add-issue/#add-issue
func (*Client) AddIssueContext ¶
func (c *Client) AddIssueContext(ctx context.Context, issue *Issue, notifiedUsers []*User) (*Issue, error)
AddIssueContext accepts context.
func (*Client) AddPullRequest ¶
func (c *Client) AddPullRequest(pullRequest *PullRequest, notifiedUsers []*User) (*PullRequest, error)
AddPullRequest Adds pull requests.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/add-pull-request/#add-pull-request
func (*Client) AddPullRequestContext ¶
func (c *Client) AddPullRequestContext(ctx context.Context, pullRequest *PullRequest, notifiedUsers []*User) (*PullRequest, error)
AddPullRequestContext accepts context.
func (*Client) AddWiki ¶ added in v0.5.0
AddWiki adds new Wiki page.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/add-wiki-page/#add-wiki-page
func (*Client) AddWikiAttachments ¶ added in v0.6.0
AddWikiAttachments creates and attaches files to Wiki
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/attach-file-to-wiki/#url-parameters
func (*Client) AddWikiAttachmentsContext ¶ added in v0.6.0
func (c *Client) AddWikiAttachmentsContext(ctx context.Context, wikiId uint64, filepaths ...string) ([]*Attachment, error)
AddWikiAttachmentsContext accepts context.
func (*Client) AddWikiContext ¶ added in v0.5.0
AddWikiContext accepts context.
func (*Client) DeleteIssue ¶
DeleteIssue deletes issue.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/delete-issue/#delete-issue
func (*Client) DeleteIssueContext ¶
DeleteIssueContext accepts context.
func (*Client) DeleteWiki ¶ added in v0.5.0
DeleteWiki deletes wiki.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/delete-wiki-page/#delete-wiki-page
func (*Client) DeleteWikiAttachment ¶ added in v0.5.0
DeleteWikiAttachment removes files attached to Wiki.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/remove-wiki-attachment/#remove-wiki-attachment
func (*Client) DeleteWikiAttachmentContext ¶ added in v0.5.0
func (c *Client) DeleteWikiAttachmentContext(ctx context.Context, wikiId, attachmentId uint64) (*Attachment, error)
DeleteWikiAttachmentContext accepts context.
func (*Client) DeleteWikiContext ¶ added in v0.5.0
DeleteWikiContext accepts context.
func (*Client) DownloadWikiAttachment ¶ added in v0.5.0
func (c *Client) DownloadWikiAttachment(wikiId, attachmentId uint64) (data []byte, filename string, err error)
DownloadWikiAttachment download Wiki page’s attachment file.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-attachment/#get-wiki-page-attachment
func (*Client) DownloadWikiAttachmentContext ¶ added in v0.5.0
func (c *Client) DownloadWikiAttachmentContext(ctx context.Context, wikiId, attachmentId uint64) (data []byte, filename string, err error)
DownloadWikiAttachmentContext accepts context.
func (*Client) GetAllIssues ¶ added in v0.2.0
GetAllIssues returns all issues.
func (*Client) GetAllIssuesContext ¶ added in v0.2.0
func (c *Client) GetAllIssuesContext(ctx context.Context, maxIssues int, query url.Values) ([]*Issue, error)
GetAllIssuesContext accepts context.
func (*Client) GetAllPullRequests ¶ added in v0.2.0
func (c *Client) GetAllPullRequests(projectIdOrKey, repositoryIdOrName string) ([]*PullRequest, error)
GetAllPullRequests returns all pull requests.
func (*Client) GetAllPullRequestsContext ¶ added in v0.2.0
func (c *Client) GetAllPullRequestsContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string) ([]*PullRequest, error)
GetAllPullRequestsContext accepts context.
func (*Client) GetIssue ¶
GetIssue returns information about issue.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-issue/#get-issue
func (*Client) GetIssueComments ¶
GetIssueComments returns list of comments in issue.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-comment-list/#get-comment-list
func (*Client) GetIssueCommentsContext ¶
func (c *Client) GetIssueCommentsContext(ctx context.Context, issueIdOrKey string, query url.Values) ([]*Comment, error)
GetIssueCommentsContext accepts context.
func (*Client) GetIssueContext ¶
GetIssueContext accepts context.
func (*Client) GetIssueTypes ¶
GetIssueTypes returns list of Issue Types in the project.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-issue-type-list/#get-issue-type-list
func (*Client) GetIssueTypesContext ¶
func (c *Client) GetIssueTypesContext(ctx context.Context, projectIdOrKey string) ([]*IssueType, error)
GetIssueTypesContext accepts context.
func (*Client) GetIssues ¶
GetIssues returns list of issues.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-issue-list/#get-issue-list
func (*Client) GetIssuesContext ¶
GetIssuesContext accepts context.
func (*Client) GetIssuesCount ¶
GetIssuesCount returns number of issues.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/count-issue/#count-issue
func (*Client) GetIssuesCountContext ¶
GetIssuesCountContext accepts context.
func (*Client) GetMyself ¶
GetMyself returns own information about user.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-own-user/#get-own-user
func (*Client) GetMyselfContext ¶
GetMyselfContext accepts context.
func (*Client) GetNotifications ¶
GetNotifications returns own notifications.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-notification/#get-notification
func (*Client) GetNotificationsContext ¶
func (c *Client) GetNotificationsContext(ctx context.Context, query url.Values) ([]*Notification, error)
GetNotificationsContext accepts context.
func (*Client) GetPriorities ¶
GetPriorities returns list of priorities.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-priority-list/#get-priority-list
func (*Client) GetPrioritiesContext ¶
GetPrioritiesContext accepts context.
func (*Client) GetProject ¶
GetProject returns information about project.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-project/#get-project
func (*Client) GetProjectContext ¶
GetProjectContext accepts context.
func (*Client) GetProjectStatuses ¶
GetProjectStatuses returns list of status in the project.
For more details, see the API document.
func (*Client) GetProjectStatusesContext ¶
func (c *Client) GetProjectStatusesContext(ctx context.Context, projectIdOrKey string) ([]*ProjectStatus, error)
GetProjectStatuses accepts context.
func (*Client) GetProjects ¶
GetProjects returns list of projects.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-project-list/#get-project-list
func (*Client) GetProjectsContext ¶
GetProjectsContext accepts context.
func (*Client) GetPullRequest ¶
func (c *Client) GetPullRequest(projectIdOrKey, repositoryIdOrName string, number int64) (*PullRequest, error)
GetPullRequest returns pull reuqest.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-pull-request/#get-pull-request
func (*Client) GetPullRequestComments ¶
func (c *Client) GetPullRequestComments(projectKeyOrId, repositoryNameOrId string, number int64, query url.Values) ([]*Comment, error)
GetPullRequestComments returns list of pull request comments.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-pull-request-comment/
func (*Client) GetPullRequestCommentsContext ¶
func (c *Client) GetPullRequestCommentsContext(ctx context.Context, projectKeyOrId, repositoryNameOrId string, number int64, query url.Values) ([]*Comment, error)
GetPullRequestCommentsContext accepts context.
func (*Client) GetPullRequestContext ¶
func (c *Client) GetPullRequestContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string, number int64) (*PullRequest, error)
GetPullRequestContext accepts context.
func (*Client) GetPullRequests ¶
func (c *Client) GetPullRequests(projectIdOrKey, repositoryIdOrName string, query url.Values) ([]*PullRequest, error)
GetPullRequests returns list of pull requests.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-pull-request-list/#get-pull-request-list
func (*Client) GetPullRequestsContext ¶
func (c *Client) GetPullRequestsContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string, query url.Values) ([]*PullRequest, error)
GetPullRequestsContext accepts context.
func (*Client) GetPullRequestsCount ¶
GetPullRequestsCount returns number of pull requests.
For more details, see the API document.
func (*Client) GetPullRequestsCountContext ¶
func (c *Client) GetPullRequestsCountContext(ctx context.Context, projectIdOrKey, repositoryIdOrName string) (int64, error)
GetPullRequestsCountContext accepts context.
func (*Client) GetRepositories ¶
GetRepositories returns list of Git repositories.
For more details, see the API document.
func (*Client) GetRepositoriesContext ¶
func (c *Client) GetRepositoriesContext(ctx context.Context, projectKeyOrId string, query url.Values) ([]*Repository, error)
GetRepositoriesContext accepts context.
func (*Client) GetRepository ¶
GetRepository returns Git repository.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-git-repository/
func (*Client) GetRepositoryContext ¶
func (c *Client) GetRepositoryContext(ctx context.Context, projectKeyOrId, repositoryNameOrId string) (*Repository, error)
getRepositoryContext accepts context.
func (*Client) GetSpace ¶
GetSpace returns information about your space.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-space/#get-space
func (*Client) GetSpaceContext ¶
GetSpaceContext accepts context.
func (*Client) GetSpaceDiskUsage ¶ added in v0.6.0
GetSpaceDiskUsage returns information about space disk usage.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-space-disk-usage/#get-space-disk-usage
func (*Client) GetSpaceDiskUsageContext ¶ added in v0.6.0
GetSpaceDiskUsageContext accepts context.
func (*Client) GetUsers ¶
GetUsers returns list of users in your space.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-user-list/#get-user-list
func (*Client) GetUsersContext ¶
GetUsersContext accepts context.
func (*Client) GetWiki ¶
GetWiki returns information about Wiki page.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-wiki-page/
func (*Client) GetWikiAttachments ¶ added in v0.5.0
GetWikiAttachments gets list of files attached to Wiki.
For more details, see the API document.
func (*Client) GetWikiAttachmentsContext ¶ added in v0.5.0
func (c *Client) GetWikiAttachmentsContext(ctx context.Context, wikiId uint64) ([]*Attachment, error)
GetWikiAttachmentsContext accepts context.
func (*Client) GetWikiContext ¶
GetWikiContext accepts context.
func (*Client) GetWikiCount ¶ added in v0.5.0
GetWikiCount returns number of Wiki pages.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/count-wiki-page/#count-wiki-page
func (*Client) GetWikiCountContext ¶ added in v0.5.0
GetWikiCountContext accepts context.
func (*Client) GetWikiTags ¶ added in v0.5.0
GetWikiTags returns list of tags that are used in the project.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-tag-list/#get-wiki-page-tag-list
func (*Client) GetWikiTagsContext ¶ added in v0.5.0
GetWikiTagsContext accepts context.
func (*Client) GetWikis ¶
GetWikis returns list of Wiki pages.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-list/#get-wiki-page-list
func (*Client) GetWikisContext ¶
func (c *Client) GetWikisContext(ctx context.Context, projectIdOrKey string, query url.Values) ([]*Wiki, error)
GetWikisContext accepts context.
func (*Client) PostAttachment ¶ added in v0.5.0
PostAttachment posts an attachment file for issue or wiki. Returns id of the attachment file.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/post-attachment-file/#post-attachment-file
func (*Client) PostAttachmentContext ¶ added in v0.5.0
PostAttachmentContext accepts context.
func (*Client) UpdateIssue ¶
UpdateIssue updates information about issue.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/update-issue/#update-issue
func (*Client) UpdateIssueContext ¶
func (c *Client) UpdateIssueContext(ctx context.Context, issue *Issue, notifiedUsers []*User, comment string) (*Issue, error)
UpdateIssueContext accepts context.
func (*Client) UpdatePullRequest ¶
func (c *Client) UpdatePullRequest(pullRequest *PullRequest, notifiedUsers []*User, comment string) (*PullRequest, error)
UpdatePullRequest updates pull requests.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/update-pull-request/#update-pull-request
func (*Client) UpdatePullRequestContext ¶
func (c *Client) UpdatePullRequestContext(ctx context.Context, pullRequest *PullRequest, notifiedUsers []*User, comment string) (*PullRequest, error)
UpdatePullRequestContext accepts context.
func (*Client) UpdateWiki ¶ added in v0.5.0
UpdateWiki updates information about Wiki page.
For more details, see the API document.
https://developer.nulab.com/docs/backlog/api/2/update-wiki-page/#update-wiki-page
type OptionFunc ¶ added in v0.6.0
type OptionFunc func(*Client)
OptionFunc modifies API client.
func OptionHTTPClient ¶ added in v0.6.0
func OptionHTTPClient(client *http.Client) OptionFunc
OptionHTTPClient sets the given HTTP client.