Documentation
¶
Overview ¶
Package trello implements the Trello cloud API provider.
Index ¶
- Constants
- func DefaultWebhookCallbackURL() string
- func GetDefaultBoardID() string
- func GetWebhookToken() string
- type Board
- type Card
- type List
- type Member
- type SearchResult
- type Trello
- func (t *Trello) CreateCard(ctx context.Context, listID, name, desc string) (*Card, error)
- func (t *Trello) DeleteCard(ctx context.Context, cardID string) error
- func (t *Trello) DeleteWebhook(ctx context.Context, webhookID string) error
- func (t *Trello) GetBoard(ctx context.Context, boardID string) (*Board, error)
- func (t *Trello) GetCard(ctx context.Context, cardID string) (*Card, error)
- func (t *Trello) GetMe(ctx context.Context) (*Member, error)
- func (t *Trello) ListBoards(ctx context.Context) ([]Board, error)
- func (t *Trello) ListCards(ctx context.Context, boardID string) ([]Card, error)
- func (t *Trello) ListLists(ctx context.Context, boardID string) ([]List, error)
- func (t *Trello) MoveCard(ctx context.Context, cardID, listID string) (*Card, error)
- func (t *Trello) RegisterWebhook(ctx context.Context, boardID, callbackURL, description string) (*Webhook, error)
- func (t *Trello) SearchCards(ctx context.Context, query string, limit int) ([]Card, error)
- func (t *Trello) UpdateCard(ctx context.Context, cardID, name, desc string) (*Card, error)
- type Webhook
- type WebhookAction
- type WebhookPayload
Constants ¶
const ( ID = "trello" APIKeyKey = "api_key" TokenKey = "token" WebhookTokenKey = "webhook_token" DefaultBoardIDKey = "default_board_id" )
Variables ¶
This section is empty.
Functions ¶
func DefaultWebhookCallbackURL ¶
func DefaultWebhookCallbackURL() string
DefaultWebhookCallbackURL builds the flowbot inbound webhook URL for Trello.
func GetDefaultBoardID ¶
func GetDefaultBoardID() string
GetDefaultBoardID reads the optional default board id from config.
func GetWebhookToken ¶
func GetWebhookToken() string
GetWebhookToken reads the inbound webhook query token from config.
Types ¶
type Board ¶
type Board struct {
ID string `json:"id"`
Name string `json:"name"`
Desc string `json:"desc,omitempty"`
Closed bool `json:"closed"`
URL string `json:"url,omitempty"`
}
Board is a Trello board resource.
type Card ¶
type Card struct {
ID string `json:"id"`
Name string `json:"name"`
Desc string `json:"desc,omitempty"`
IDBoard string `json:"idBoard"`
IDList string `json:"idList"`
Pos float64 `json:"pos,omitempty"`
Closed bool `json:"closed"`
URL string `json:"url,omitempty"`
ShortURL string `json:"shortUrl,omitempty"`
}
Card is a Trello card.
type List ¶
type List struct {
ID string `json:"id"`
Name string `json:"name"`
Closed bool `json:"closed"`
IDBoard string `json:"idBoard"`
Pos float64 `json:"pos,omitempty"`
}
List is a Trello list on a board.
type Member ¶
type Member struct {
ID string `json:"id"`
FullName string `json:"fullName,omitempty"`
Username string `json:"username,omitempty"`
}
Member is a Trello member (used for health checks).
type SearchResult ¶
type SearchResult struct {
Cards []Card `json:"cards"`
}
SearchResult holds card matches from Trello search.
type Trello ¶
type Trello struct {
// contains filtered or unexported fields
}
Trello is an HTTP client for the Trello REST API.
func GetClient ¶
func GetClient() *Trello
GetClient builds a Trello client from vendors.trello config. Returns nil when api_key or token is not configured.
func (*Trello) CreateCard ¶
CreateCard creates a card on a list.
func (*Trello) DeleteCard ¶
DeleteCard deletes a card.
func (*Trello) DeleteWebhook ¶
DeleteWebhook deletes a webhook by id.
func (*Trello) ListBoards ¶
ListBoards returns boards for the authenticated member.
func (*Trello) RegisterWebhook ¶
func (t *Trello) RegisterWebhook(ctx context.Context, boardID, callbackURL, description string) (*Webhook, error)
RegisterWebhook registers a board webhook with Trello.
func (*Trello) SearchCards ¶
SearchCards searches cards with the Trello search API.
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
Description string `json:"description,omitempty"`
IDModel string `json:"idModel"`
CallbackURL string `json:"callbackURL"`
Active bool `json:"active"`
}
Webhook is a registered Trello webhook.
type WebhookAction ¶
type WebhookAction struct {
ID string `json:"id"`
Type string `json:"type"`
Data map[string]any `json:"data"`
}
WebhookAction is the action object inside a Trello webhook payload.
type WebhookPayload ¶
type WebhookPayload struct {
Action WebhookAction `json:"action"`
Model map[string]any `json:"model"`
}
WebhookPayload is the top-level Trello webhook body.