go-flowdock

module
v0.0.0-...-93c0a78 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2017 License: BSD-2-Clause

README

go-flowdock

go-flowdock is Go client library for accessing the Flowdock API.

GoDoc Build Status Coverage Status

go-flowdock requires Go version 1.1 or greater.

Usage

import "github.com/wm/go-flowdock/flowdock"
Authentication

The go-flowdock library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for you. The easiest and recommended way to do this is using the goauth2 library, but you can always use any other library that provides an http.Client. If you have an OAuth2 access token (for example, a personal API token), you can use it with the goauth2 using:

t := &oauth.Transport{
  Token: &oauth.Token{AccessToken: "... your access token ..."},
}

client := flowdock.NewClient(t.Client())

// list all flows the authenticated user is a member of or can join
flows, _, err := client.Flows.List(true, nil)

See the goauth2 docs for complete instructions on using that library.

Some API methods have optional parameters that can be passed. For example, To not return users when listing Flows you can pass in options:

client := flowdock.NewClient(t.Client())
opt := flowdock.FlowsListOptions{User: false}
flows, _, err := client.Flows.List(true, &opt)

For complete usage of go-flowdock, see the full package docs.

Contributing

This is very early in the implementation and I am basing the client heavily on the go-github implementation. Feel free to open a pull request and use this lib or go-github as a guide.

License

This library is distributed under the BSD-style license found in the LICENSE file.

Directories

Path Synopsis
A command to test against the real service
A command to test against the real service
Golang Flowdock client (REST API)
Golang Flowdock client (REST API)

Jump to

Keyboard shortcuts

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