gogroovehq

package module
Version: v0.0.0-...-9235a27 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: MIT Imports: 6 Imported by: 0

README

Groove API Go library

This is a partial implementation of Groove that we've built at Roadmap when we implemented our Groove integration.

Install

go get -u github.com/roadmap-space/gogroovehq

Usage

package main

import (
	"fmt"
	"log"
	"github.com/roadmap-space/gogroovehq
)

func main() {
	gapi := gogroovehq.New("YOUR_GROOVE_API_TOKEN")
	tiket, err := gapi.Tickets.Get("ticket_id")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(ticket)
}

A tiny implementation

We were only needing Webhooks create, Tickets get by id and Customers get by id.

But this is a good basis to continue implementing the rest of Groove's API.

Unit tests

The unit tests uses hard-coded resources ID.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPTimeout = 2 * time.Second

HTTPTimeout is the maximum number of second to wait for the API responses.

Functions

This section is empty.

Types

type Client

type Client struct {
	BasePath string

	Tickets   *tickets
	Customers *customers
	Webhooks  *webhooks
	// contains filtered or unexported fields
}

Client is used to perform API HTTP requests

func New

func New(token string) *Client

New creates a new Client with your GrooveHQ API tocken

type Customer

type Customer struct {
	Customer struct {
		Href  string `json:"href"`
		Links struct {
			Tickets struct {
				Href string `json:"href"`
			} `json:"tickets"`
		} `json:"links"`
		Email            string      `json:"email"`
		Name             string      `json:"name"`
		About            interface{} `json:"about"`
		TwitterUsername  interface{} `json:"twitter_username"`
		Title            interface{} `json:"title"`
		CompanyName      interface{} `json:"company_name"`
		PhoneNumber      interface{} `json:"phone_number"`
		Location         interface{} `json:"location"`
		WebsiteURL       interface{} `json:"website_url"`
		LinkedinUsername interface{} `json:"linkedin_username"`
	} `json:"customer"`
}

Customer represents a GrooveHQ customer

type Ticket

type Ticket struct {
	Ticket struct {
		AssignedGroup  interface{} `json:"assigned_group"`
		CreatedAt      time.Time   `json:"created_at"`
		Number         int         `json:"number"`
		Priority       interface{} `json:"priority"`
		ResolutionTime interface{} `json:"resolution_time"`
		Title          interface{} `json:"title"`
		UpdatedAt      time.Time   `json:"updated_at"`
		Href           string      `json:"href"`
		ClosedBy       string      `json:"closed_by"`
		Tags           []string    `json:"tags"`
		MessageCount   int         `json:"message_count"`
		Summary        string      `json:"summary"`
		Links          struct {
			Assignee struct {
				Href string `json:"href"`
			} `json:"assignee"`
			Customer struct {
				Href string `json:"href"`
			} `json:"customer"`
			State struct {
				Href string `json:"href"`
			} `json:"state"`
			Messages struct {
				Href string `json:"href"`
			} `json:"messages"`
		} `json:"links"`
	} `json:"ticket"`
}

Ticket represents a GrooveHQ ticket

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL