Documentation
¶
Overview ¶
Package confluence provides a client for the Confluence REST API. It integrates with the storage package for reading and writing pages using Confluence Storage Format.
Index ¶
- type APIError
- type AuthMethod
- type BasicAuth
- type BearerAuth
- type Client
- func (c *Client) CreatePage(ctx context.Context, spaceKey, title string, page *storage.Page, ...) (string, error)
- func (c *Client) CreatePageRaw(ctx context.Context, spaceKey, title, xhtml, parentID string) (string, error)
- func (c *Client) DeletePage(ctx context.Context, pageID string) error
- func (c *Client) GetPageStorage(ctx context.Context, pageID string) (*storage.Page, *PageInfo, error)
- func (c *Client) GetPageStorageRaw(ctx context.Context, pageID string) (string, *PageInfo, error)
- func (c *Client) GetSpace(ctx context.Context, spaceKey string) (*SpaceInfo, error)
- func (c *Client) SearchPages(ctx context.Context, cql string, limit int) ([]PageInfo, error)
- func (c *Client) UpdatePageStorage(ctx context.Context, pageID string, page *storage.Page, version int, ...) error
- func (c *Client) UpdatePageStorageRaw(ctx context.Context, pageID, xhtml string, version int, title string) error
- type Option
- type PageInfo
- type SpaceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
AuthMethod represents an authentication method.
type BearerAuth ¶
type BearerAuth struct {
Token string
}
BearerAuth implements bearer token authentication.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Confluence REST API client.
func NewClient ¶
func NewClient(baseURL string, auth AuthMethod, opts ...Option) *Client
NewClient creates a new Confluence client.
func (*Client) CreatePage ¶
func (c *Client) CreatePage(ctx context.Context, spaceKey, title string, page *storage.Page, parentID string) (string, error)
CreatePage creates a new page with IR content.
func (*Client) CreatePageRaw ¶
func (c *Client) CreatePageRaw(ctx context.Context, spaceKey, title, xhtml, parentID string) (string, error)
CreatePageRaw creates a new page with raw Storage XHTML.
func (*Client) DeletePage ¶
DeletePage deletes a page by ID.
func (*Client) GetPageStorage ¶
func (c *Client) GetPageStorage(ctx context.Context, pageID string) (*storage.Page, *PageInfo, error)
GetPageStorage retrieves a page's content as Storage Format, parsed to IR.
func (*Client) GetPageStorageRaw ¶
GetPageStorageRaw retrieves a page's raw Storage XHTML.
func (*Client) SearchPages ¶
SearchPages searches for pages matching the given CQL query.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.