Documentation ¶
Index ¶
- Constants
- Variables
- func GetPluginToken(host, pluginID, pluginSecret string) (token string, expirationTime int64, err error)
- type Client
- func (c *Client) Comment(projectKey, workItemTypeKey string, workItemID int64, comment string) (int64, error)
- func (c *Client) GetProjectList() ([]*NamespaceDetail, error)
- func (c *Client) GetWorkFlowInfo(projectKey, workItemTypeKey string, workItemID int) ([]*Connection, []*StateFlowNode, error)
- func (c *Client) GetWorkItem(projectKey, workItemTypeKey string, workItemID int) (*WorkItem, error)
- func (c *Client) GetWorkItemList(projectKey, workItemTypeKey, nameQuery string, pageNum, pageSize int) ([]*WorkItem, error)
- func (c *Client) GetWorkItemTypesList(projectKey string) ([]*WorkItemType, error)
- func (c *Client) StatusTransition(projectKey, workItemTypeKey string, workItemID int, transitionID int64) error
- type Connection
- type CreateCommentReq
- type CreateCommentResp
- type GeneralError
- type GeneralWebhookPayload
- type GeneralWebhookRequest
- type GetNamespaceDetailRequest
- type GetNamespaceDetailResult
- type GetNamespaceRequest
- type GetNamespaceResult
- type GetPluginData
- type GetPluginTokenRequest
- type GetPluginTokenResult
- type GetWorkItemListReq
- type GetWorkItemListResp
- type GetWorkItemTypeResp
- type GetWorkflowReq
- type GetWorkflowResp
- type NamespaceDetail
- type NodesConnections
- type StateFlowNode
- type StatusTransitionReq
- type StatusTransitionResp
- type WebhookHeader
- type WorkItem
- type WorkItemStatus
- type WorkItemType
- type WorkflowNode
Constants ¶
View Source
const ( PluginTokenHeader = "X-Plugin-Token" UserKeyHeader = "X-USER-KEY" DefaultMeegoHost = "https://project.feishu.cn" )
API Related consts
View Source
const ( PluginTokenType = 0 VirtualPluginTokenType = 1 WorkflowType = 0 StatusFlowType = 1 )
Variables ¶
View Source
var TokenExpirationMap sync.Map
Since we only allow one meego integration at a time, we store the pluginToken in the memory
Functions ¶
Types ¶
type Client ¶
type Client struct { Host string PluginID string PluginSecret string PluginToken string UserKey string }
func (*Client) GetProjectList ¶
func (c *Client) GetProjectList() ([]*NamespaceDetail, error)
func (*Client) GetWorkFlowInfo ¶
func (c *Client) GetWorkFlowInfo(projectKey, workItemTypeKey string, workItemID int) ([]*Connection, []*StateFlowNode, error)
func (*Client) GetWorkItem ¶
func (*Client) GetWorkItemList ¶
func (*Client) GetWorkItemTypesList ¶
func (c *Client) GetWorkItemTypesList(projectKey string) ([]*WorkItemType, error)
type Connection ¶
type CreateCommentReq ¶
type CreateCommentReq struct {
Content string `json:"content"`
}
type CreateCommentResp ¶
type GeneralError ¶
type GeneralWebhookPayload ¶
type GeneralWebhookRequest ¶
type GeneralWebhookRequest struct { Header *WebhookHeader `json:"header"` Payload *GeneralWebhookPayload `json:"payload"` }
type GetNamespaceDetailResult ¶
type GetNamespaceDetailResult struct { Data map[string]*NamespaceDetail `json:"data"` ErrorMessage string `json:"err_msg"` ErrorCode int `json:"err_code"` Error interface{} `json:"error"` }
type GetNamespaceRequest ¶
type GetNamespaceRequest struct {
UserKey string `json:"user_key"`
}
type GetNamespaceResult ¶
type GetPluginData ¶
type GetPluginTokenRequest ¶
type GetPluginTokenResult ¶
type GetPluginTokenResult struct { Data *GetPluginData `json:"data"` Error *GeneralError `json:"error"` }
type GetWorkItemListReq ¶
type GetWorkItemListResp ¶
type GetWorkItemTypeResp ¶
type GetWorkItemTypeResp struct { Data []*WorkItemType `json:"data"` ErrorMessage string `json:"err_msg"` ErrorCode int `json:"err_code"` Error interface{} `json:"error"` }
type GetWorkflowReq ¶
type GetWorkflowResp ¶
type GetWorkflowResp struct { Data *NodesConnections `json:"data"` ErrorMessage string `json:"err_msg"` ErrorCode int `json:"err_code"` Error interface{} `json:"error"` }
type NamespaceDetail ¶
type NodesConnections ¶
type NodesConnections struct { WorkflowNodes []*WorkflowNode `json:"workflow_nodes"` Connections []*Connection `json:"connections"` StateflowNodes []*StateFlowNode `json:"state_flow_nodes"` }
type StateFlowNode ¶
type StatusTransitionReq ¶
type StatusTransitionReq struct {
TransitionID int64 `json:"transition_id"`
}
type StatusTransitionResp ¶
type WebhookHeader ¶
type WorkItem ¶
type WorkItem struct { ID int `json:"id"` Name string `json:"name"` SimpleName string `json:"simple_name"` TemplateType string `json:"template_type"` WorkItemStatus *WorkItemStatus `json:"work_item_status"` WorkflowInfos *NodesConnections `json:"workflow_infos"` }
type WorkItemStatus ¶
type WorkItemStatus struct {
StateKey string `json:"state_key"`
}
type WorkItemType ¶
type WorkflowNode ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.