Documentation ¶
Overview ¶
Package confluence provides functionality for interacting with the confluence APIClient Specifically managing pages
Index ¶
- type APIClient
- func (a *APIClient) CreatePage(root int, contents *markdown.FileContents, isroot bool) (int, error)
- func (a *APIClient) DeletePage(pageID int) error
- func (a *APIClient) FindPage(title string, many bool) (*PageResults, error)
- func (a *APIClient) UpdatePage(pageID int, pageVersion int64, pageContents *markdown.FileContents, ...) (bool, error)
- func (a *APIClient) UploadAttachment(filename string, id int, isindex bool, indexid int) error
- type AncestorObj
- type BodyObj
- type HTTPClient
- type Page
- type PageResults
- type SpaceObj
- type StorageObj
- type VersionObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { BaseURL string Space string Username string Password string Client HTTPClient }
APIClient struct for interacting with confluence
func APIClientWithAuths ¶
func APIClientWithAuths(httpClient HTTPClient) *APIClient
APIClientWithAuths returns an APIClient with dependencies defaulted to sane values
func CreateAPIClient ¶
CreateAPIClient creates the API client with relevant login details for confluence's API
func (*APIClient) CreatePage ¶
CreatePage method takes root (root page id) and page contents and bool (is page root?) and generates a page in confluence and returns the generated page ID nolint: gocyclo // 11 is just about fine
func (*APIClient) DeletePage ¶
DeletePage deletes a confluence page by page ID
func (*APIClient) FindPage ¶
func (a *APIClient) FindPage(title string, many bool) (*PageResults, error)
FindPage in confluence Docs for this API endpoint are here https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-api-content-get
func (*APIClient) UpdatePage ¶
func (a *APIClient) UpdatePage(pageID int, pageVersion int64, pageContents *markdown.FileContents, originalPage PageResults) (bool, error)
UpdatePage updates a confluence page with our newly created data and increases the version by 1 each time.
type AncestorObj ¶
type AncestorObj struct {
ID int `json:"id,omitempty"`
}
AncestorObj contains the page ID of a parent page
type BodyObj ¶
type BodyObj struct {
Storage StorageObj `json:"storage"`
}
BodyObj stores body object
type HTTPClient ¶
HTTPClient interface will allow mock Do request
type Page ¶
type Page struct { ID string `json:"id,omitempty"` Type string `json:"type"` Status string `json:"status"` Title string `json:"title"` Space SpaceObj `json:"space,omitempty"` Version VersionObj `json:"version,omitempty"` Ancestors []AncestorObj `json:"ancestors,omitempty"` Body BodyObj `json:"body,omitempty"` }
Page holds returned confluence data
type PageResults ¶
type PageResults struct {
Results []Page `json:"results"`
}
PageResults contains the returned page values
type SpaceObj ¶
type SpaceObj struct {
Key string `json:"key,omitempty"`
}
SpaceObj contains the confluence space value
type StorageObj ¶
type StorageObj struct { Value string `json:"value"` Representation string `json:"representation,omitempty"` }
StorageObj stores storage object
type VersionObj ¶
type VersionObj struct {
Number int `json:"number"`
}
VersionObj stores page version increased by 1 for PUT request
Directories ¶
Path | Synopsis |
---|---|
test
|
|
confluencemocks
Package confluencemocks is a generated GoMock package.
|
Package confluencemocks is a generated GoMock package. |