/gotm1

unofficial go (golang) IBM TM1 Planning Analytics API

Primary LanguageGoMIT LicenseMIT

GOTM1

Build status GoReport GoDoc codebeat badge


Package gotm1 provides an idiomatic golang implementation of IBM TM1 Planning Analytics REST API, allowing clients to manage processes, and query data that is stored in the model.

Audience

To use this library effectively, you must be familiar with the following areas:

  • TM1 and the TM1 architecture
  • Dimensional data and modeling terminology and concepts
  • Go (golang) programming language

Installation and configuration

This library has no other dependency so you can go get like so:

$ go get -u https://github.com/tarcisio/gotm1

This project is compatible with go modules.

How to use

The main package is github.com/tarcisio/gotm1, to make it nicely decoupled and make easier to test, the http client was created.

import (
	"fmt"
	"log"

	"github.com/tarcisio/gotm1"
	"github.com/tarcisio/gotm1/http"
)

tm1 := gotm1.New(
  http.NewSimpleHTTPClient(
    http.WithHost("tm1.example.com"),
    http.WithPort(8091),
    http.WithUsername("c6548654"),
    http.WithPassword("p@$$w0rd"),
    http.WithNamespace("CompanyLDAP"),
    http.WithCognosIntegratedLogin(),
    http.WithTimeoutConnection(5),
  ),
)
defer tm1.Logout()

cubes, err := tm1.GetCubes()

for _, cube := range cubes {
  fmt.Println(cube.Name)
}