trello

package
v0.99.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package trello implements the Trello cloud API provider.

Index

Constants

View Source
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 NewTrello

func NewTrello(apiKey, token string) *Trello

NewTrello creates a Trello API client.

func (*Trello) CreateCard

func (t *Trello) CreateCard(ctx context.Context, listID, name, desc string) (*Card, error)

CreateCard creates a card on a list.

func (*Trello) DeleteCard

func (t *Trello) DeleteCard(ctx context.Context, cardID string) error

DeleteCard deletes a card.

func (*Trello) DeleteWebhook

func (t *Trello) DeleteWebhook(ctx context.Context, webhookID string) error

DeleteWebhook deletes a webhook by id.

func (*Trello) GetBoard

func (t *Trello) GetBoard(ctx context.Context, boardID string) (*Board, error)

GetBoard returns a board by id.

func (*Trello) GetCard

func (t *Trello) GetCard(ctx context.Context, cardID string) (*Card, error)

GetCard returns a card by id.

func (*Trello) GetMe

func (t *Trello) GetMe(ctx context.Context) (*Member, error)

GetMe returns the authenticated member (health check).

func (*Trello) ListBoards

func (t *Trello) ListBoards(ctx context.Context) ([]Board, error)

ListBoards returns boards for the authenticated member.

func (*Trello) ListCards

func (t *Trello) ListCards(ctx context.Context, boardID string) ([]Card, error)

ListCards returns cards on a board.

func (*Trello) ListLists

func (t *Trello) ListLists(ctx context.Context, boardID string) ([]List, error)

ListLists returns lists on a board.

func (*Trello) MoveCard

func (t *Trello) MoveCard(ctx context.Context, cardID, listID string) (*Card, error)

MoveCard moves a card to another list.

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

func (t *Trello) SearchCards(ctx context.Context, query string, limit int) ([]Card, error)

SearchCards searches cards with the Trello search API.

func (*Trello) UpdateCard

func (t *Trello) UpdateCard(ctx context.Context, cardID, name, desc string) (*Card, error)

UpdateCard updates card fields.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL