• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rest api implementation in golang of atlassian's confluence wiki

confluence-go-api

Donate GoDoc Go Report Card License 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: using personal access tokens. 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.

Pre-Commit

This repo uses pre-commit hooks. Please install pre-commit and do pre-commit install

Conventional Commits

Format commit messaged according to Conventional Commits standard.

Semantic Versioning

Whenever you need to version something make use of Semantic Versioning.