resharmonics

package module
v0.0.0-2429 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 9 Imported by: 0

README

Build status

Motivation

This is a Go client to consume Resharmonics API.

To the best of my knowledge there isn't any other library publicly available to consume Resharmonics API.

Getting started

See the test folder for an example

import "github.com/JoseFMP/resharmonics"


func main(){

    creds := resharmonics.Credentials{ Username: "foo", Password: "baar" }

    rhClient, errSettingUpClient := resharmonics.Init(creds)

    if(errSettingUpClient != nil){
        panic("Something went wrong setting up Resharmonics client")
    }

    rhClient.....
    // go for gold!

}

API

Currently Resharmonics exposes two APIs that are in principle unrelated (from an IT point of view) but related (they mean the same data):

  • Rerum API: https://api.rerumapp.uk/swagger/index.html - Mostly "backend" based view of the data. Information lies in a data lake where you can hardly use any filter when quering the data. In practice this means that you should use this API to "scrap" data and import it into your own systems with the structure that fits your needs.

  • Guest portal: https://app.swaggerhub.com/apis/resharmonics-apis/guest-portal/1.1.0# - This part isn't yet covered in this library. This API provides a "guest" point of view to access the data. So whenever you interact with this API, each request has an implicit guest associated with it. There are some caveats though, as currently the guest needs to be separately registered in the gust portal.

   

Collaboration

If you want to collaborate just mail me at jose@mingorance.engineer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookingReference

type BookingReference string

func (*BookingReference) AsCanonical

func (original *BookingReference) AsCanonical() string

type Client

type Client interface {
	//Auth() error
	DoPost(subPath string, params map[string]string) ([]byte, error)
	DoGet(subPath string, params map[string]interface{}) ([]byte, error)
}

Client client

func Init

func Init(cred Credentials, preAuthorize bool) (Client, error)

Init gives you a Resharmonics client with functionality to do HTTP requests and authenticate

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type OrganizationID

type OrganizationID int
const DefaultOrganizationID OrganizationID = 0

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL