trello

package
v0.99.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package trello implements the Trello cloud capability.

Index

Constants

View Source
const (
	OpListBoards      = "list_boards"
	OpGetBoard        = "get_board"
	OpListLists       = "list_lists"
	OpListCards       = "list_cards"
	OpGetCard         = "get_card"
	OpSearchCards     = "search_cards"
	OpCreateCard      = "create_card"
	OpUpdateCard      = "update_card"
	OpMoveCard        = "move_card"
	OpDeleteCard      = "delete_card"
	OpRegisterWebhook = "register_webhook"
	OpDeleteWebhook   = "delete_webhook"
	OpHealth          = "health"
)

Variables

This section is empty.

Functions

func CatalogSpec

func CatalogSpec() capability.Spec

CatalogSpec returns capability metadata for documentation.

func Register

func Register(app string, svc Service) error

Register registers the trello capability with hub and invoker registry.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements Service using the Trello provider client.

func (*Adapter) CreateCard

func (a *Adapter) CreateCard(ctx context.Context, listID, name, desc string) (*capability.TrelloCard, error)

func (*Adapter) DeleteCard

func (a *Adapter) DeleteCard(ctx context.Context, cardID string) error

func (*Adapter) DeleteWebhook

func (a *Adapter) DeleteWebhook(ctx context.Context, webhookID string) error

func (*Adapter) GetBoard

func (a *Adapter) GetBoard(ctx context.Context, boardID string) (*capability.TrelloBoard, error)

func (*Adapter) GetCard

func (a *Adapter) GetCard(ctx context.Context, cardID string) (*capability.TrelloCard, error)

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)

func (*Adapter) ListBoards

func (*Adapter) ListCards

func (a *Adapter) ListCards(ctx context.Context, boardID string, q *ListQuery) (*capability.ListResult[capability.TrelloCard], error)

func (*Adapter) ListLists

func (a *Adapter) ListLists(ctx context.Context, boardID string) ([]*capability.TrelloList, error)

func (*Adapter) MoveCard

func (a *Adapter) MoveCard(ctx context.Context, cardID, listID string) (*capability.TrelloCard, error)

func (*Adapter) RegisterWebhook

func (a *Adapter) RegisterWebhook(ctx context.Context, boardID, callbackURL, description string) (*capability.TrelloWebhook, error)

func (*Adapter) SearchCards

func (a *Adapter) SearchCards(ctx context.Context, query string, limit int) ([]*capability.TrelloCard, error)

func (*Adapter) UpdateCard

func (a *Adapter) UpdateCard(ctx context.Context, cardID, name, desc string) (*capability.TrelloCard, error)

type ListQuery

type ListQuery struct {
	Page capability.PageRequest
}

ListQuery wraps pagination for list operations.

type Service

type Service interface {
	ListBoards(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.TrelloBoard], error)
	GetBoard(ctx context.Context, boardID string) (*capability.TrelloBoard, error)
	ListLists(ctx context.Context, boardID string) ([]*capability.TrelloList, error)
	ListCards(ctx context.Context, boardID string, q *ListQuery) (*capability.ListResult[capability.TrelloCard], error)
	GetCard(ctx context.Context, cardID string) (*capability.TrelloCard, error)
	SearchCards(ctx context.Context, query string, limit int) ([]*capability.TrelloCard, error)
	CreateCard(ctx context.Context, listID, name, desc string) (*capability.TrelloCard, error)
	UpdateCard(ctx context.Context, cardID, name, desc string) (*capability.TrelloCard, error)
	MoveCard(ctx context.Context, cardID, listID string) (*capability.TrelloCard, error)
	DeleteCard(ctx context.Context, cardID string) error
	RegisterWebhook(ctx context.Context, boardID, callbackURL, description string) (*capability.TrelloWebhook, error)
	DeleteWebhook(ctx context.Context, webhookID string) error
	HealthCheck(ctx context.Context) (bool, error)
}

Service defines the Trello capability contract.

func New

func New() Service

New creates an Adapter from provider config. Returns nil when not configured.

func NewWithClient

func NewWithClient(c client) Service

NewWithClient creates an Adapter with the given client.

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook implements capability.WebhookConverter for Trello inbound webhooks.

func NewWebhook

func NewWebhook() *Webhook

NewWebhook creates a Webhook that reads the query token from provider config.

func (*Webhook) Convert

func (*Webhook) Convert(body []byte, _ map[string]string) ([]types.DataEvent, error)

Convert transforms a Trello webhook payload into DataEvent records.

func (*Webhook) SupportsWebhookHEAD

func (*Webhook) SupportsWebhookHEAD() bool

SupportsWebhookHEAD reports that Trello probes webhook URLs with HEAD during registration.

func (*Webhook) VerifySignature

func (w *Webhook) VerifySignature(headers map[string]string, _ []byte) error

VerifySignature validates the webhook token from the query parameter.

func (*Webhook) WebhookPath

func (*Webhook) WebhookPath() string

WebhookPath returns the URL path segment for Trello webhooks. Full URL: /webhook/provider/trello/events?token=TOKEN

Jump to

Keyboard shortcuts

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