GithubHelp home page GithubHelp logo

xtroncode / go-hangouts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seibert-media/go-hangouts

1.0 2.0 0.0 673 KB

Google Hangouts Chat Library for Golang

License: BSD 2-Clause "Simplified" License

Makefile 13.10% Go 86.90%

go-hangouts's Introduction

Google Hangouts Chat Library for Golang

Go Report Card GoDoc

Shortly after Hangouts Chat became publicly available, we built seibert-media/hangouts-jira-bot to try out how the bot connectivity works.

While doing this, one of our first steps was to build this mapping to easily create messages. As we are now aiming to try out building more bots and integrating Chat into our tool landscape it became reasonable to offer this as a standalone library which is well documented.

In addition to this, we added further helpers to easily build messages available in builder.go.

Requirements

All dependencies are managed using dep and checked into git. To update those dependencies use dep ensure --update after you added new imports to your code.

For building or running tests a onetime execution of make deps might be required.

Usage

For now, this package only offers sending messages. To receive messages and events, we suggest using PubSub. This implementation might be added here in the future but is out of scope for now. To learn how to do this, check the official docs or give our jira bot a look.

This package offers both a default connection using Google Service Accounts and sending messages via channel webhooks.

The entire connection Part relies on github.com/playnet-public/libs/log for logging. If you are not using Zap and are an external user, you could simply use log.NewNop() when initializing the connection to get an empty no-op logger.

Service Account

To send messages using a service account, use New(...) which is using the Google DefaultClient for taking credential as described here.

To send messages onto a webhook use NewWebhookClient(...).

Afterwards you can simply use Send(...) to post your messages. Check out code comments for further information on how to use this.

Examples

go-hangouts's People

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

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.