golatch1

package module
v0.0.0-...-8a19718 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2016 License: MIT Imports: 15 Imported by: 2

README

golatch1

Build Status

Eleven paths Latch minimum client in golang

#Example

Import the library

import "github.com/amassanet/golatch1"

Initialize with the application id and the secret

la := golatch1.NewLatchApp(appId, appSecret) 

Or initialize with custom transport

la := golatch1.NewLatchAppWithTransport(appId, appSecret,&http.Client{})

Pair and create an account

accountId, err := la.Pair(token)

Get the status

statusIsOn, err = la.StatusIsOn(accountId);

Unpair the account

err := la.Unpair(accountId);

Documentation

Index

Constants

View Source
const (
	ServiceURL = "https://latch.elevenpaths.com"
)

Variables

View Source
var (
	ErrAlreadyPaired = errors.New("LatchError 205 Account and application already paired")
	ErrTokenNotFound = errors.New("LatchError 206 Pairing token not found or expired")
)

Functions

This section is empty.

Types

type LatchApp

type LatchApp struct {
	// contains filtered or unexported fields
}

func NewLatchApp

func NewLatchApp(appId string, secret string) *LatchApp

Creates a new LatchApp with the supplied appId and secret

func NewLatchAppWithTransport

func NewLatchAppWithTransport(appId string, secret string, transport *http.Client) *LatchApp

Creates a new LatchApp with the supplied appId and secret, but also specifying the transport

func (*LatchApp) Pair

func (app *LatchApp) Pair(token string) (accountId string, err error)

func (*LatchApp) StatusIsOn

func (app *LatchApp) StatusIsOn(accountId string) (bool, error)

func (*LatchApp) Unpair

func (app *LatchApp) Unpair(accountId string) error

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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