confluence

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package confluence implements DocsAdapter using the Confluence REST API.

Outbound (the hardened, primary path): converts spec markdown to Confluence storage format (XHTML) and publishes the full page as a child of a configured parent page. Frontmatter is rendered as a metadata info panel, markdown links and inline formatting are preserved, and all prose is XML-escaped so arbitrary spec content (e.g. "List<T>", "a < b", "Q&A") produces well-formed storage XML. Pages are bound to their spec by a durable Confluence label so lookups survive human title edits. Section markers (<!-- spec-section: slug -->) are still emitted to support inbound.

Inbound (best-effort): fetches the Confluence page and parses XHTML storage format back to markdown sections keyed by slug. The conversion is lossy for complex formatting and depends on HTML-comment markers that Confluence's editor may strip; it is retained for compatibility but not the focus of the hardened mirror.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements adapter.DocsAdapter using the Confluence REST API.

func NewClient

func NewClient(opts Options) *Client

NewClient creates a Confluence DocsAdapter from Options.

func (*Client) FetchSections

func (c *Client) FetchSections(ctx context.Context, specID string) (map[string]string, error)

FetchSections retrieves the spec page from Confluence and returns section content keyed by slug. Sections are identified by <!-- spec-section: slug --> markers inserted during outbound push, or by heading-based slug derivation.

func (*Client) PageURL

func (c *Client) PageURL(ctx context.Context, specID string) (string, error)

PageURL returns the URL of the spec's Confluence page.

func (*Client) PushFull

func (c *Client) PushFull(ctx context.Context, specID string, content string) error

PushFull publishes the complete spec to Confluence. Creates the page if it doesn't exist, or updates it if it does. The page title is derived from the spec frontmatter ("SPEC-042 — Title") for readability; identity is bound to a durable label, not the title, so renames don't orphan the mirror.

type Options added in v0.32.0

type Options struct {
	// BaseURL includes the /wiki path, e.g. "https://myorg.atlassian.net/wiki".
	BaseURL string
	// SpaceKey is the human space key (e.g. "ENG"). Resolved to a numeric
	// space id lazily for page creation.
	SpaceKey string
	// ParentID is the numeric id of the parent page under which spec pages are
	// created. Required: it keeps the mirror navigable instead of dumping
	// pages at the space root.
	ParentID string
	Email    string
	Token    string
	// Timeout overrides defaultTimeout when non-zero.
	Timeout time.Duration
}

Options configures a Confluence DocsAdapter.

Jump to

Keyboard shortcuts

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