icron / go-confluence

Go package for working with Atlassian Confluence REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

codebeat badge

InstallationUsage exampleBuild StatusLicense


go-confluence is a Go package for working with Confluence REST API.

Currently, this package support only getting data from API (i.e., you cannot create or modify data using this package).

Installation

Before the initial install allows git to use redirects for pkg.re service (reason why you should do this described here):

git config --global http.https://pkg.re.followRedirects true

Make sure you have a working Go 1.10+ workspace (instructions), then:

go get pkg.re/essentialkaos/go-confluence.v4

For update to latest stable release, do:

go get -u pkg.re/essentialkaos/go-confluence.v4

Usage example

package main

import (
  "fmt"
  cf "pkg.re/essentialkaos/go-confluence.v4"
)

func main() {
  api, err := cf.NewAPI("https://confluence.domain.com", "john", "MySuppaPAssWOrd")
  api.SetUserAgent("MyApp", "1.2.3")

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  content, err := cf.GetContentByID(
    "18173522", cf.ContentIDParameters{
      Version: 4,
      Expand:  []string{"space", "body.view", "version"},
    },
  )

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  fmt.Println("ID: %s\n", content.ID)
}

Build Status

Branch Status
master (Stable) Build Status
develop (Unstable) Build Status

License

EKOL

About

Go package for working with Atlassian Confluence REST API

License:Other


Languages

Language:Go 97.9%Language:Makefile 2.1%