confluence

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadToken

func LoadToken() (*atlassian.Token, error)

LoadToken loads the Confluence token from the config file

func SaveToken

func SaveToken(token *atlassian.Token) error

SaveToken saves the Confluence token to the config file

func StripHTML

func StripHTML(s string) string

StripHTML removes HTML tags from a string for plain text display

Types

type Client

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

func NewClient

func NewClient() (*Client, error)

func (*Client) EnsureAuth

func (c *Client) EnsureAuth(ctx context.Context) error

EnsureAuth ensures we have a valid token, refreshing or re-authenticating as needed

func (*Client) GetPage

func (c *Client) GetPage(ctx context.Context, pageID string) (*Page, error)

GetPage fetches a single page by ID

func (*Client) GetSiteURL

func (c *Client) GetSiteURL() string

GetSiteURL returns the browsable Confluence site URL

func (*Client) ListSpaces

func (c *Client) ListSpaces(ctx context.Context, limit int) ([]Space, error)

ListSpaces lists Confluence spaces

func (*Client) Search

func (c *Client) Search(ctx context.Context, cql string, limit int) (*SearchResult, error)

Search searches Confluence using CQL

type Page

type Page struct {
	ID      string `json:"id"`
	Status  string `json:"status"`
	Title   string `json:"title"`
	SpaceID string `json:"spaceId"`
	Body    struct {
		Storage struct {
			Value string `json:"value"`
		} `json:"storage"`
	} `json:"body"`
	Version struct {
		Number    int    `json:"number"`
		Message   string `json:"message"`
		CreatedAt string `json:"createdAt"`
	} `json:"version"`
	Links struct {
		WebUI string `json:"webui"`
	} `json:"_links"`
}

Page represents a Confluence page

type SearchResult

type SearchResult struct {
	Results []struct {
		Content struct {
			ID    string `json:"id"`
			Type  string `json:"type"`
			Title string `json:"title"`
		} `json:"content"`
		Excerpt              string `json:"excerpt"`
		URL                  string `json:"url"`
		LastModified         string `json:"lastModified"`
		FriendlyLastModified string `json:"friendlyLastModified"`
	} `json:"results"`
	Start     int `json:"start"`
	Limit     int `json:"limit"`
	Size      int `json:"size"`
	TotalSize int `json:"totalSize"`
}

SearchResult represents a Confluence search result

type Space

type Space struct {
	ID          string `json:"id"`
	Key         string `json:"key"`
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description struct {
		Plain struct {
			Value string `json:"value"`
		} `json:"plain"`
	} `json:"description"`
	HomepageID string `json:"homepageId"`
}

Space represents a Confluence space

Jump to

Keyboard shortcuts

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