confluence

package
v0.0.0-...-2c71b50 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	BaseURL string
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(baseURL string, username string, password string) *API

func (*API) AddPageLabels

func (api *API) AddPageLabels(page *PageInfo, newLabels []string) (*LabelInfo, error)

func (*API) CreateAttachment

func (api *API) CreateAttachment(
	pageID string,
	name string,
	comment string,
	reader io.Reader,
) (AttachmentInfo, error)

func (*API) CreatePage

func (api *API) CreatePage(
	space string,
	pageType string,
	parent *PageInfo,
	title string,
	body string,
) (*PageInfo, error)

func (*API) DeletePageLabel

func (api *API) DeletePageLabel(page *PageInfo, label string) (*LabelInfo, error)

func (*API) FindHomePage

func (api *API) FindHomePage(space string) (*PageInfo, error)

func (*API) FindPage

func (api *API) FindPage(
	space string,
	title string,
	pageType string,
) (*PageInfo, error)

func (*API) FindRootPage

func (api *API) FindRootPage(space string) (*PageInfo, error)

func (*API) GetAttachments

func (api *API) GetAttachments(pageID string) ([]AttachmentInfo, error)

func (*API) GetCurrentUser

func (api *API) GetCurrentUser() (*User, error)

func (*API) GetPageByID

func (api *API) GetPageByID(pageID string) (*PageInfo, error)

func (*API) GetPageLabels

func (api *API) GetPageLabels(page *PageInfo, prefix string) (*LabelInfo, error)

func (*API) GetUserByName

func (api *API) GetUserByName(name string) (*User, error)

func (*API) RestrictPageUpdates

func (api *API) RestrictPageUpdates(
	page *PageInfo,
	allowedUser string,
) error

func (*API) RestrictPageUpdatesCloud

func (api *API) RestrictPageUpdatesCloud(
	page *PageInfo,
	allowedUser string,
) error

func (*API) RestrictPageUpdatesServer

func (api *API) RestrictPageUpdatesServer(
	page *PageInfo,
	allowedUser string,
) error

func (*API) UpdateAttachment

func (api *API) UpdateAttachment(
	pageID string,
	attachID string,
	name string,
	comment string,
	reader io.Reader,
) (AttachmentInfo, error)

UpdateAttachment uploads a new version of the same attachment if the checksums differs from the previous one. It also handles a case where Confluence returns sort of "short" variant of the response instead of an extended one.

func (*API) UpdatePage

func (api *API) UpdatePage(page *PageInfo, newContent string, minorEdit bool, versionMessage string, newLabels []string, appearance string) error

type AttachmentInfo

type AttachmentInfo struct {
	Filename string `json:"title"`
	ID       string `json:"id"`
	Metadata struct {
		Comment string `json:"comment"`
	} `json:"metadata"`
	Links struct {
		Context  string `json:"context"`
		Download string `json:"download"`
	} `json:"_links"`
}

type Label

type Label struct {
	ID     string `json:"id"`
	Prefix string `json:"prefix"`
	Name   string `json:"name"`
}

type LabelInfo

type LabelInfo struct {
	Labels []Label `json:"results"`
	Size   int     `json:"number"`
}

type PageInfo

type PageInfo struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Type  string `json:"type"`

	Version struct {
		Number int64 `json:"number"`
	} `json:"version"`

	Ancestors []struct {
		ID    string `json:"id"`
		Title string `json:"title"`
	} `json:"ancestors"`

	Links struct {
		Full string `json:"webui"`
	} `json:"_links"`
}

type SpaceInfo

type SpaceInfo struct {
	ID   int    `json:"id"`
	Key  string `json:"key"`
	Name string `json:"name"`

	Homepage PageInfo `json:"homepage"`

	Links struct {
		Full string `json:"webui"`
	} `json:"_links"`
}

type User

type User struct {
	AccountID string `json:"accountId,omitempty"`
	UserKey   string `json:"userKey,omitempty"`
}

Jump to

Keyboard shortcuts

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