Coder Social home page Coder Social logo

theodesp / go-hipchat Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 90 KB

go-hipchat is a Go client library for accessing the Hipchat API

Home Page: https://godoc.org/github.com/theodesp/go-hipchat/hipchat

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.89% Go 99.11%
hipchat golang go api-client hipchat-api

go-hipchat's Introduction

go-hipchat - WIP

GoDoc License

go-hipchat is a Go client library for accessing the Hipchat API v2.

go-hipchat requires Go version 1.8 or greater.

This is WIP!

Usage

import "github.com/theodesp/go-hipchat/hipchat"

Construct a new HipChat client, then use the various services on the client to access different parts of the HipChat API. For example:

Some API methods have optional parameters that can be passed. For example:

NOTE: Using the context package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background() can be used as a starting point.

For more sample code snippets, head over to the examples directory.

Authentication

The go-hipchat 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 oauth2 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 oauth2 library using:

Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users.

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

Rate Limiting

Hipchat imposes a rate limit on all API clients. 500 API requests per 5 minutes. Once you exceed the limit, calls will return HTTP status 429.

Learn more about HipChat rate limiting at https://developer.atlassian.com/server/hipchat/hipchat-rest-api-rate-limits.

Response Codes

https://developer.atlassian.com/server/hipchat/hipchat-rest-api-response-codes

For complete usage of go-hipchat, see the full [package docs][https://godoc.org/github.com/theodesp/go-hipchat/hipchat].

Roadmap

Contributing

Versioning

In general, go-hipchat follows semver as closely as we can for tagging releases of the package. For self-contained libraries, the application of semantic versioning is relatively straightforward and generally understood. But because go-hipchat is a client library for the HipChat API, which itself changes behavior, and because we are typically pretty aggressive about implementing preview features of the HipChat API, we've adopted the following versioning policy:

  • We increment the major version with any incompatible change to non-preview functionality, including changes to the exported Go API surface or behavior of the API.
  • We increment the minor version with any backwards-compatible changes to functionality, as well as any changes to preview functionality in the HipChat API.
  • We increment the patch version with any backwards-compatible bug fixes.

Preview functionality may take the form of entire methods or simply additional data returned from an otherwise non-preview method. Refer to the HipChat API documentation for details on preview functionality.

License

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

go-hipchat's People

Stargazers

 avatar

Watchers

 avatar

go-hipchat's Issues

Add parameter field validation

In some endpoints some parameters have limits on the API, for example maxResults have
Valid length range: 1 - 1000.

We need to enforce a field validation service for that

Implement Base Hipchat Client

Based on the examples in the folder, we need to create a Hipchat client that will delegate the requests for each service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.