Categorygithub.com/perolo/confluence-go-api
modulepackage
1.4.1
Repository: https://github.com/perolo/confluence-go-api.git
Documentation: pkg.go.dev

# README

confluence-go-api

Remark: This is a fork from virtomize - not yet merged

Main features:

  • Using a properties file to make automation easier
  • The Extender for Confluence plugin, used for user, group and permissions

Donate GoDoc Go Report Card License Build Status Built with Mage

is a Confluence REST API client implementation written in GOLANG.

Supported Features

  • get, update, delete content
  • get, update, delete content templates and blueprints
  • get comments, attachments, children of content objects, history, watchers
  • get, add ,delete labels
  • get user information
  • search using CQL

If you miss some feature implementation, feel free to open an issue or send pull requests. I will take look as soon as possible.

Donation

If this project helps you, feel free to give us a cup of coffee :).

paypal

Installation

If you already installed GO on your system and configured it properly than its simply:

go get github.com/virtomize/confluence-go-api

If not follow these instructions

Usage

Simple example

package main

import (
  "fmt"
  "log"

  "github.com/virtomize/confluence-go-api"
)

func main() {

  // initialize a new api instance
  api, err := goconfluence.NewAPI("https://<your-domain>.atlassian.net/wiki/rest/api", "<username>", "<api-token>")
  if err != nil {
    log.Fatal(err)
  }

  // get current user information
  currentUser, err := api.CurrentUser()
  if err != nil {
    log.Fatal(err)
  }
  fmt.Printf("%+v\n", currentUser)
}

Using a Personal Access Token

To generate a confluence personal access token (PAT) see this article: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html. Only set the token in the NewAPI function

  api, err := goconfluence.NewAPI("https://<your-domain>.atlassian.net/wiki/rest/api", "", "<personal-access-token>")

Advanced examples

see examples for some more usage examples

Code Documentation

You find the full code documentation here.

The Confluence API documentation can be found here.

Contribution

Thank you for participating to this project. Please see our Contribution Guidlines for more information.

# Packages

No description provided by the author

# Functions

Debug outputs debug messages.
NewAPI implements API constructor.
NewAPIWithClient creates a new API instance using an existing HTTP client.
SetDebug enables debug output.
StripHTML removes the specified information from the HTML and sets it as a string.

# Variables

DebugFlag is the global debugging variable.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
AllSpacesQuery defines the query parameters Query parameter values https://developer.atlassian.com/cloud/confluence/rest/#api-space-get.
Ancestor defines ancestors to create sub pages.
API is the main api data structure.
Body holds the storage information.
BodyExportView holds the export_view information.
Content specifies content properties.
ContentAppearanceDraft sets the appearance of the content in draft form.
ContentAppearancePublished sets the appearance of the content in published form.
ContentQuery defines the query parameters used for content related searching Query parameter values https://developer.atlassian.com/cloud/confluence/rest/#api-content-get.
ContentSearch results.
No description provided by the author
Editor contains editor information.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
History contains object history information.
Label contains label information.
Labels is the label containter type.
LastUpdated contains information about the last update.
Links contains link information.
Metadata specifies metadata properties.
No description provided by the author
Properties defines properties of the editor.
Results array.
Search results.
SearchQuery defines query parameters used for searchng Query parameter values https://developer.atlassian.com/cloud/confluence/rest/#api-search-get.
Space holds the Space information of a Content Page.
Storage defines the storage information.
Template contains blueprint data.
TemplateQuery defines the query parameters.
TemplateSearch contains blueprint search results.
User defines user informations.
No description provided by the author
Version defines the content version number the version number is used for updating content.
Watcher contains information about watching users of a page.
Watchers is a list of Watcher.

# Type aliases

No description provided by the author