Documentation
¶
Overview ¶
Package confluence implements the Confluence Cloud capability adapter.
Package confluence implements the Confluence Cloud capability.
Index ¶
- Constants
- func CatalogSpec() capability.Spec
- func Register(app string, svc Service) error
- type Adapter
- func (a *Adapter) CreatePage(ctx context.Context, spaceKey, title, content string) (*capability.ConfluencePage, error)
- func (a *Adapter) DeletePage(ctx context.Context, pageID string) error
- func (a *Adapter) GetPage(ctx context.Context, pageID string) (*capability.ConfluencePage, error)
- func (a *Adapter) GetPageContent(ctx context.Context, pageID string) (string, error)
- func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)
- func (a *Adapter) ListPages(ctx context.Context, spaceKey string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
- func (a *Adapter) ListSpaces(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.ConfluenceSpace], error)
- func (a *Adapter) SearchPages(ctx context.Context, cql string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
- func (a *Adapter) UpdatePage(ctx context.Context, pageID, title, content string) (*capability.ConfluencePage, error)
- type ListQuery
- type Service
- type Webhook
Constants ¶
const ( OpListSpaces = "list_spaces" OpListPages = "list_pages" OpGetPage = "get_page" OpGetPageContent = "get_page_content" OpSearchPages = "search_pages" OpCreatePage = "create_page" OpUpdatePage = "update_page" OpDeletePage = "delete_page" OpHealth = "health" )
Variables ¶
This section is empty.
Functions ¶
func CatalogSpec ¶
func CatalogSpec() capability.Spec
CatalogSpec returns capability metadata for documentation.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements Service using the Confluence provider client.
func (*Adapter) CreatePage ¶
func (a *Adapter) CreatePage(ctx context.Context, spaceKey, title, content string) (*capability.ConfluencePage, error)
func (*Adapter) GetPage ¶
func (a *Adapter) GetPage(ctx context.Context, pageID string) (*capability.ConfluencePage, error)
func (*Adapter) GetPageContent ¶
func (*Adapter) ListPages ¶
func (a *Adapter) ListPages(ctx context.Context, spaceKey string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
func (*Adapter) ListSpaces ¶
func (a *Adapter) ListSpaces(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.ConfluenceSpace], error)
func (*Adapter) SearchPages ¶
func (a *Adapter) SearchPages(ctx context.Context, cql string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
func (*Adapter) UpdatePage ¶
func (a *Adapter) UpdatePage(ctx context.Context, pageID, title, content string) (*capability.ConfluencePage, error)
type ListQuery ¶
type ListQuery struct {
Page capability.PageRequest
}
ListQuery wraps pagination for list operations.
type Service ¶
type Service interface {
ListSpaces(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.ConfluenceSpace], error)
ListPages(ctx context.Context, spaceKey string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
GetPage(ctx context.Context, pageID string) (*capability.ConfluencePage, error)
GetPageContent(ctx context.Context, pageID string) (string, error)
SearchPages(ctx context.Context, cql string, q *ListQuery) (*capability.ListResult[capability.ConfluencePage], error)
CreatePage(ctx context.Context, spaceKey, title, content string) (*capability.ConfluencePage, error)
UpdatePage(ctx context.Context, pageID, title, content string) (*capability.ConfluencePage, error)
DeletePage(ctx context.Context, pageID string) error
HealthCheck(ctx context.Context) (bool, error)
}
Service defines the Confluence 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 Confluence automation webhooks. Configure Confluence Automation to POST JSON with optional fields:
{"event":"page_created","id":"evt-1","page":{"id":"123","title":"..."},"space":{"key":"DEV"}}
func NewWebhook ¶
func NewWebhook() *Webhook
NewWebhook creates a Webhook that reads the query token from provider config.
func (*Webhook) VerifySignature ¶
VerifySignature validates the webhook token from the query parameter.
func (*Webhook) WebhookPath ¶
WebhookPath returns the URL path segment for Confluence webhooks. Full URL: /webhook/provider/confluence/events?token=TOKEN