GithubHelp home page GithubHelp logo

seibert-media / go-hangouts Goto Github PK

View Code? Open in Web Editor NEW
4.0 7.0 3.0 674 KB

Deprecated in favor of the official api: https://github.com/googleapis/google-api-go-client/blob/master/chat/v1/chat-gen.go

License: BSD 2-Clause "Simplified" License

Makefile 12.98% Go 87.02%
golang go google hangouts hangouts-chat api-client builder

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

Contributors

kwiesmueller avatar xtroncode avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-hangouts's Issues

Comparison with official Google chat client?

Hello!

First of all, thanks for putting this project out there!

In the hangouts chat docs, there is a reference to an official google chat client library for go: https://github.com/google/google-api-go-client/tree/master/chat/v1

This library is auto-generated, so it's a bit messy but it does seem to be feature complete.

I was wondering if you had any experience with this official library, and if you were aware of any pros/cons of using each. Just trying to understand the best place to get started.

Thanks!

Check and Update API

During the last year a few new features in chat as well as missing functions in our code were found.
It's about time we check the current API with the Docs and look for stuff we missed.
As there is no changelog for chat this will be manual effort.

WithImage method missing

Hi,
I am using this library to send messages to google chat and want to add images to the message, but could not find the WithImage method for the widget. I think it should be there to add an image widget. I have opened a PR #2 for the same. Please review.

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.