# README
🚀 Go-Tapd-SDK
The Go-Tapd-SDK is a Go client library for accessing the Tapd API.
[!WARNING]
This is currently still a non-stable version, is not recommended for production use.
If you encounter any issues, you are welcome to submit an issue.
📥 Installation
go get github.com/go-tapd/tapd
✨ Features
see features.md
🔧 Usage
API Service
package main
import (
"context"
"log"
"github.com/go-tapd/tapd"
)
func main() {
client, err := tapd.NewClient("username", "password")
if err != nil {
log.Fatal(err)
}
// example: get labels
labels, _, err := client.LabelService.GetLabels(context.Background(), &tapd.GetLabelsRequest{
WorkspaceID: tapd.Ptr(123456),
})
if err != nil {
log.Fatal(err)
}
log.Printf("labels: %+v", labels)
}
Webhook Server Example
package main
import (
"context"
"log"
"net/http"
"github.com/go-tapd/tapd/webhook"
)
type StoreUpdateListener struct{}
func (l *StoreUpdateListener) OnStoryUpdate(ctx context.Context, event *webhook.StoryUpdateEvent) error {
log.Printf("StoreUpdateListener: %+v", event)
return nil
}
func main() {
dispatcher := webhook.NewDispatcher(
webhook.WithRegisters(&StoreUpdateListener{}),
)
dispatcher.Registers(&StoreUpdateListener{})
srv := http.NewServeMux()
srv.HandleFunc("/webhook", func(w http.ResponseWriter, r *http.Request) {
log.Println("Received webhook request")
if err := dispatcher.DispatchRequest(r); err != nil {
log.Println(err)
}
w.Write([]byte("ok"))
})
http.ListenAndServe(":8080", srv)
}
📜 License
The MIT License (MIT). Please see License File for more information.
# Packages
No description provided by the author
# Functions
No description provided by the author
NewBasicAuthClient returns a new Tapd API client with basic authentication.
NewClient returns a new Tapd API client.
NewEnum creates a new enum value.
NewMulti creates a new multi value.
NewOrder creates a new order parameter.
No description provided by the author
Ptr returns a pointer to the value.
WithBaseURL sets the baseURL for the client.
WithBasicAuth sets the username and password for the client.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
bug.
bug_remark (流转缺陷时候的评论).
mini_items.
stories.
tasks.
wiki.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
API变更.
自动化任务触发.
自动化工作流触发.
代码变更.
创建需求.
复制创建.
退出项目触发.
导入更新.
创建关联.
删除关联.
更新关联.
手动变更.
Smart Commit触发.
状态删除.
父子需求联动.
需求任务联动.
同步复制联动.
已评审.
开发中.
待测试.
处理中.
规划中.
已拒绝.
已处理.
测试中.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
已完成.
未开始.
进行中.
# Structs
Attachment 附件.
AttachmentService is the service to communicate with Attachment API.
No description provided by the author
BugService 缺陷服务.
No description provided by the author
Comment 评论.
CommentService 评论服务.
CountResponse represents the response of count.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrorResponse represents a tapd error response.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetReportsRequest represents a request to get reports.
GetRolesRequest represents a request to get roles.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IterationService 迭代
https://open.tapd.cn/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/iteration/.
No description provided by the author
No description provided by the author
LabelService handles communication with the label related methods of the Tapd API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Order is a type for order parameters.
RawBody represents a raw body.
No description provided by the author
Report 项目报告.
ReportService is a service to interact with report related API.
Response represents an API response.
SettingService 配置
https://open.tapd.cn/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/setting/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Task 任务.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TaskService 任务服务.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserService is a service to interact with user related API.
No description provided by the author
No description provided by the author
WorkflowService 工作流.
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
BugSeverity 缺陷严重程度(severity)
https://open.tapd.cn/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/bug/bug.html#%E7%BC%BA%E9%99%B7%E4%B8%A5%E9%87%8D%E7%A8%8B%E5%BA%A6-severity-%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.
No description provided by the author
CommentEntryType 评论类型.
No description provided by the author
No description provided by the author
LabelColor is a type for label colors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReportStatus 报告状态(sent:已发送, draft:草稿, abandon:已删除).
ReportType 报告类型(normal:项目进度报告, totest:项目转测试, test:测试报告).
No description provided by the author
No description provided by the author
StoreChangeType 变更类型
https://open.tapd.cn/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/story/get_story_changes.html.
No description provided by the author
No description provided by the author
TaskStatus 任务状态.