Documentation
¶
Index ¶
- func BuildAgentWebSocketURL(baseURL string, token string) (string, error)
- func ConnectStream(ctx context.Context, streamURL string) (*websocket.Conn, error)
- func SendStreamChunk(ctx context.Context, conn StreamConn, cardID, text, chunkType string, ...) error
- type APIError
- type ActivityOptions
- type BoardLabelCatalog
- type CardLabelState
- type CardMetadata
- type CardPatch
- type Client
- func (c *Client) AddCardLabel(ctx context.Context, cardID, labelID string) error
- func (c *Client) AddCardLink(ctx context.Context, cardID, linkURL, displayText string) (json.RawMessage, error)
- func (c *Client) AddComment(ctx context.Context, cardID, content string) (json.RawMessage, error)
- func (c *Client) AddCommentOnce(ctx context.Context, cardID, content string) (json.RawMessage, error)
- func (c *Client) AddTodo(ctx context.Context, cardID, checklistID, title string) (json.RawMessage, error)
- func (c *Client) AddTodos(ctx context.Context, cardID, checklistTitle string, items []string) (json.RawMessage, error)
- func (c *Client) ArchiveBoard(ctx context.Context, boardID string) (json.RawMessage, error)
- func (c *Client) ArchiveCard(ctx context.Context, cardID string) (json.RawMessage, error)
- func (c *Client) BoardCardSearch(ctx context.Context, boardID, query string, limit int) (json.RawMessage, error)
- func (c *Client) CompleteTodo(ctx context.Context, cardID, todoID string) (json.RawMessage, error)
- func (c *Client) CreateCard(ctx context.Context, boardID, listID, title, description string) (json.RawMessage, error)
- func (c *Client) CreateChecklist(ctx context.Context, cardID, title string) (json.RawMessage, error)
- func (c *Client) CreateList(ctx context.Context, boardID, name string) (json.RawMessage, error)
- func (c *Client) DeleteCardLink(ctx context.Context, cardID, linkID string) error
- func (c *Client) DeleteComment(ctx context.Context, cardID, commentID string) error
- func (c *Client) DownloadAttachment(ctx context.Context, cardID, attachmentID string, dst io.Writer) error
- func (c *Client) ExtractChecklistToCards(ctx context.Context, sourceCardID, checklistID, targetListID, prefix string) (json.RawMessage, error)
- func (c *Client) ExtractTodosToCards(ctx context.Context, sourceCardID, targetListID, prefix string) (json.RawMessage, error)
- func (c *Client) GetActivity(ctx context.Context, opts ActivityOptions) (json.RawMessage, error)
- func (c *Client) GetAttachment(ctx context.Context, cardID, attachmentID string) (json.RawMessage, error)
- func (c *Client) GetBoard(ctx context.Context, boardID string, includeArchived bool) (json.RawMessage, error)
- func (c *Client) GetBoardActivity(ctx context.Context, boardID string, opts ActivityOptions) (json.RawMessage, error)
- func (c *Client) GetBoardActivityMarkdown(ctx context.Context, boardID string, opts ActivityOptions) (string, error)
- func (c *Client) GetBoardLabelCatalog(ctx context.Context, boardID string) (BoardLabelCatalog, error)
- func (c *Client) GetBoardLabels(ctx context.Context, boardID string) (json.RawMessage, error)
- func (c *Client) GetBoardMarkdown(ctx context.Context, boardID string, includeArchived bool) (string, error)
- func (c *Client) GetCard(ctx context.Context, cardID string) (json.RawMessage, error)
- func (c *Client) GetCardActivity(ctx context.Context, cardID string, opts ActivityOptions) (json.RawMessage, error)
- func (c *Client) GetCardLabelState(ctx context.Context, cardID string) (CardLabelState, error)
- func (c *Client) GetCardMarkdown(ctx context.Context, cardID string) (string, error)
- func (c *Client) GetCardMetadata(ctx context.Context, cardID string) (CardMetadata, error)
- func (c *Client) GetComment(ctx context.Context, cardID, commentID string) (json.RawMessage, error)
- func (c *Client) ListAttachments(ctx context.Context, cardID string) (json.RawMessage, error)
- func (c *Client) ListBoards(ctx context.Context) (json.RawMessage, error)
- func (c *Client) ListBoardsMarkdown(ctx context.Context) (string, error)
- func (c *Client) ListCardLinks(ctx context.Context, cardID string) (json.RawMessage, error)
- func (c *Client) MoveCard(ctx context.Context, cardID, listID string, position *int) (json.RawMessage, error)
- func (c *Client) MoveCardToBoard(ctx context.Context, cardID, boardID string) (json.RawMessage, error)
- func (c *Client) MoveList(ctx context.Context, listID string, position int) (json.RawMessage, error)
- func (c *Client) RegisterSkills(ctx context.Context, skills []SkillPayload) (json.RawMessage, error)
- func (c *Client) RemoveCardLabel(ctx context.Context, cardID, labelID string) error
- func (c *Client) ReopenTodo(ctx context.Context, cardID, todoID string) (json.RawMessage, error)
- func (c *Client) Request(ctx context.Context, method, path string, body any, out any) error
- func (c *Client) RequestMarkdown(ctx context.Context, path string) (string, error)
- func (c *Client) RequestRaw(ctx context.Context, method, path string, body any) (json.RawMessage, error)
- func (c *Client) Search(ctx context.Context, query string, opts SearchOptions) (json.RawMessage, error)
- func (c *Client) SetNoRetry(noRetry bool)
- func (c *Client) ToggleBoardFavorite(ctx context.Context, boardID string) (json.RawMessage, error)
- func (c *Client) ToggleReaction(ctx context.Context, cardID, commentID, emoji string) (json.RawMessage, error)
- func (c *Client) UnarchiveBoard(ctx context.Context, boardID string) (json.RawMessage, error)
- func (c *Client) UnarchiveCard(ctx context.Context, cardID string) (json.RawMessage, error)
- func (c *Client) UpdateBoard(ctx context.Context, boardID, name string) (json.RawMessage, error)
- func (c *Client) UpdateCard(ctx context.Context, cardID string, patch CardPatch) (json.RawMessage, error)
- func (c *Client) UpdateCardLink(ctx context.Context, cardID, linkID string, patch LinkPatch) (json.RawMessage, error)
- func (c *Client) UpdateCardMetadata(ctx context.Context, cardID string, patch MetadataPatch) (json.RawMessage, error)
- func (c *Client) UpdateTodo(ctx context.Context, cardID, checklistID, itemID string, patch TodoPatch) (json.RawMessage, error)
- func (c *Client) UploadAttachment(ctx context.Context, cardID, filePath string) (json.RawMessage, error)
- func (c *Client) UploadFileContent(ctx context.Context, cardID, filename string, content []byte, ...) (json.RawMessage, error)
- func (c *Client) UploadMarkdownContent(ctx context.Context, cardID, filename, content string) (json.RawMessage, error)
- type ConnectedMessage
- type Label
- type LinkPatch
- type MetadataPatch
- type SearchOptions
- type SkillPayload
- type StatusPingPayload
- type StreamConn
- type TodoPatch
- type WebSocketClient
- func (c *WebSocketClient) Connect(ctx context.Context) (*websocket.Conn, error)
- func (c *WebSocketClient) ReadLoop(ctx context.Context, conn *websocket.Conn) error
- func (c *WebSocketClient) Run(ctx context.Context) error
- func (c *WebSocketClient) SendStatusPing(ctx context.Context, subscription any, activeCards []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAgentWebSocketURL ¶
func ConnectStream ¶
func SendStreamChunk ¶
Types ¶
type ActivityOptions ¶
type BoardLabelCatalog ¶ added in v0.10.0
BoardLabelCatalog is the subset of a board response required to validate card labels.
type CardLabelState ¶ added in v0.10.0
type CardLabelState struct {
ID string `json:"id"`
Board struct {
ID string `json:"id"`
} `json:"board"`
Labels []Label `json:"labels"`
}
CardLabelState is the subset of a card response required to reconcile its label set.
type CardMetadata ¶ added in v0.11.0
type CardMetadata struct {
ID string `json:"id"`
Metadata map[string]json.RawMessage `json:"metadata"`
MetadataRevision int64 `json:"metadata_revision"`
}
CardMetadata retains JSON numbers without converting them to floating point.
type Client ¶
type Client struct {
BaseURL string
Token string
HTTPClient *http.Client
// contains filtered or unexported fields
}
func (*Client) AddCardLabel ¶ added in v0.10.0
func (*Client) AddCardLink ¶
func (*Client) AddComment ¶
func (*Client) AddCommentOnce ¶ added in v0.11.0
func (c *Client) AddCommentOnce(ctx context.Context, cardID, content string) (json.RawMessage, error)
AddCommentOnce avoids retrying a non-idempotent comment creation request.
func (*Client) ArchiveBoard ¶
func (*Client) ArchiveCard ¶
func (*Client) BoardCardSearch ¶
func (*Client) CompleteTodo ¶
func (*Client) CreateCard ¶
func (*Client) CreateChecklist ¶
func (*Client) CreateList ¶
func (*Client) DeleteCardLink ¶
func (*Client) DeleteComment ¶
func (*Client) DownloadAttachment ¶ added in v0.13.1
func (c *Client) DownloadAttachment(ctx context.Context, cardID, attachmentID string, dst io.Writer) error
DownloadAttachment resolves the authenticated API redirect, then streams the object without forwarding the board token or API cookies to object storage.
func (*Client) ExtractChecklistToCards ¶
func (*Client) ExtractTodosToCards ¶
func (*Client) GetActivity ¶
func (c *Client) GetActivity(ctx context.Context, opts ActivityOptions) (json.RawMessage, error)
func (*Client) GetAttachment ¶
func (*Client) GetBoardActivity ¶
func (c *Client) GetBoardActivity(ctx context.Context, boardID string, opts ActivityOptions) (json.RawMessage, error)
func (*Client) GetBoardActivityMarkdown ¶
func (*Client) GetBoardLabelCatalog ¶ added in v0.10.0
func (*Client) GetBoardLabels ¶
func (*Client) GetBoardMarkdown ¶
func (*Client) GetCardActivity ¶
func (c *Client) GetCardActivity(ctx context.Context, cardID string, opts ActivityOptions) (json.RawMessage, error)
func (*Client) GetCardLabelState ¶ added in v0.10.0
func (*Client) GetCardMarkdown ¶
func (*Client) GetCardMetadata ¶ added in v0.11.0
func (*Client) GetComment ¶
func (*Client) ListAttachments ¶
func (*Client) ListBoards ¶
func (*Client) ListBoardsMarkdown ¶
func (*Client) ListCardLinks ¶
func (*Client) MoveCardToBoard ¶
func (*Client) RegisterSkills ¶
func (c *Client) RegisterSkills(ctx context.Context, skills []SkillPayload) (json.RawMessage, error)
func (*Client) RemoveCardLabel ¶ added in v0.10.0
func (*Client) ReopenTodo ¶
func (*Client) RequestMarkdown ¶
func (*Client) RequestRaw ¶
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, query string, opts SearchOptions) (json.RawMessage, error)
func (*Client) SetNoRetry ¶ added in v0.11.0
SetNoRetry configures the client to make at most one transport attempt for each logical request. It also leaves redirect responses untouched so an authenticated request cannot be replayed at a redirect target.
func (*Client) ToggleBoardFavorite ¶
func (*Client) ToggleReaction ¶
func (*Client) UnarchiveBoard ¶
func (*Client) UnarchiveCard ¶
func (*Client) UpdateBoard ¶
func (*Client) UpdateCard ¶
func (*Client) UpdateCardLink ¶
func (*Client) UpdateCardMetadata ¶ added in v0.11.0
func (c *Client) UpdateCardMetadata(ctx context.Context, cardID string, patch MetadataPatch) (json.RawMessage, error)
func (*Client) UpdateTodo ¶
func (*Client) UploadAttachment ¶
func (*Client) UploadFileContent ¶
func (*Client) UploadMarkdownContent ¶
type ConnectedMessage ¶
type Label ¶ added in v0.10.0
Label is the minimal label representation returned by card and board detail endpoints.
type MetadataPatch ¶ added in v0.11.0
type MetadataPatch struct {
Set map[string]json.RawMessage `json:"set,omitempty"`
Remove []string `json:"remove,omitempty"`
ExpectedRevision int64 `json:"expected_revision"`
}
type SearchOptions ¶
type SkillPayload ¶
type StatusPingPayload ¶
type StreamConn ¶
type WebSocketClient ¶
type WebSocketClient struct {
BaseURL string
Token string
Dialer *websocket.Dialer
Conn *websocket.Conn
OnConnected func(ConnectedMessage)
OnBoardEvent func(json.RawMessage)
OnError func(string)
}
func NewWebSocketClient ¶
func NewWebSocketClient(baseURL string, token string) *WebSocketClient