• Stars
    star
    163
  • Rank 231,141 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go Library to send messages to Slack via Webhooks

GoDoc

slack-go-webhook

Go Lang library to send messages to Slack via Incoming Webhooks.

Usage

package main

import "github.com/ashwanthkumar/slack-go-webhook"
import "fmt"

func main() {
    webhookUrl := "https://hooks.slack.com/services/foo/bar/baz"

    attachment1 := slack.Attachment {}
    attachment1.AddField(slack.Field { Title: "Author", Value: "Ashwanth Kumar" }).AddField(slack.Field { Title: "Status", Value: "Completed" })
    attachment1.AddAction(slack.Action { Type: "button", Text: "Book flights 🛫", Url: "https://flights.example.com/book/r123456", Style: "primary" })
    attachment1.AddAction(slack.Action { Type: "button", Text: "Cancel", Url: "https://flights.example.com/abandon/r123456", Style: "danger" })
    payload := slack.Payload {
      Text: "Hello from <https://github.com/ashwanthkumar/slack-go-webhook|slack-go-webhook>, a Go-Lang library to send slack webhook messages.\n<https://golangschool.com/wp-content/uploads/golang-teach.jpg|golang-img>",
      Username: "robot",
      Channel: "#general",
      IconEmoji: ":monkey_face:",
      Attachments: []slack.Attachment{attachment1},
    }
    err := slack.Send(webhookUrl, "", payload)
    if len(err) > 0 {
      fmt.Printf("error: %s\n", err)
    }
}

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

More Repositories

1

gocd-slack-build-notifier

GoCD (gocd.org) plugin to push build notifications to Slack
Java
96
star
2

gocd-build-github-pull-requests

GoCD plugin to build PRs for a Github repo
Java
95
star
3

slack-java-webhook

Java Client to Slack's Webhook feature.
Java
67
star
4

suuchi

सूचि - Toolkit to build Distributed Data Systems
Scala
53
star
5

marathon-alerts

Marathon App alerts to Slack (for now)
Go
27
star
6

Live-NSE-Stock

Self hosting, Live NSE Stock API for any kind of purpose.
JavaScript
25
star
7

gocd-janitor

Attempt at a more intelligent GoCD purge policy
Java
16
star
8

uClassify-PHP5

PHP Class for accessing uClassify services
PHP
13
star
9

scraphp

Web Crawler daemon in PHP, use XPath to get content into objects and persist them.
PHP
12
star
10

golang-utils

Reusable golang code, I use across my projects
Go
11
star
11

serve

Serve Single Page Applications with custom proxies to talk to different backend services at runtime and different environments
Go
9
star
12

gocd-build-badge-notifier

GoCD Plugin to send pipeline notifications to an instance of https://github.com/ashwanthkumar/gocd-build-badge-server
Java
9
star
13

distributed-rocksdb-talk

References to Distributed RocksDB
8
star
14

gotlb

Go lang based TCP Load Balancer for Marathon (and other backends)
Go
7
star
15

gocd-build-badge-server

Build Badge for your GoCD builds
JavaScript
7
star
16

chrome-tts-tamizh

Chrome TTS Engine for Tamil
JavaScript
6
star
17

go-gocd

Go Lang library to access GoCD API.
Go
5
star
18

spam_moderation

SPAM detection for Elgg 1.8+
PHP
5
star
19

mrcube

Scalding CUBE operators
Scala
4
star
20

slicer

Scala
4
star
21

marathonctl

CLI client to Mesosphere Marathon + WIP Package Manager
Go
4
star
22

gocd-java-client

JAVA Client for GoCD API
Java
4
star
23

meghaduta

Notification system built for Amazon Hackathon (Sept 2015)
Java
3
star
24

webnaplo

SASTRA SRC Campus ERP
PHP
3
star
25

talks

List of all talks given at various meetups and conferences
3
star
26

my-java-utils

Set of java utils that I generally carry around when I write OSS java projects.
Java
3
star
27

monzo-crawler

Solution to problem statement for Monzo's take home assignment
Go
3
star
28

go-cd-simple-email-task-plugin

GoCD EMail Task plugin
Java
3
star
29

finder

Wayback like system for any datasets.
Scala
2
star
30

aro-php

Doc Comment Parsing Wrapper in PHP, used in my final year project
PHP
2
star
31

pdf-diff-service

Exposing https://github.com/JoshData/pdf-diff/ as FastAPI service.
Python
2
star
32

scalding-dataflow

Scalding Runner for Google Dataflow
Scala
2
star
33

airtable-pdf-diff-block

Airtable Block that helps you find Diff between any 2 PDF Documents.
TypeScript
2
star
34

resume

TeX
2
star
35

ioc-php

Simple Inversion of Control system in PHP, implemented as a part of my final year project.
PHP
2
star
36

lisphp

Lisp parser in PHP
PHP
2
star
37

hadoop-autokill

Auto Kill jobs in Hadoop Cluster after specified time
Java
2
star
38

kite-history

Script to build Personal Database of Historical Options Data from NIFTY, BANKNIFTY and FINNIFTY
JavaScript
2
star
39

php5-goibibo

PHP5 Client for GoIbibo
PHP
2
star
40

rootconf-2016

Notes from RootConf 2016
2
star
41

subhdb

NoSQL datastore abstraction for MySQL and PHP
PHP
2
star
42

qwerty

Making travelling social since TechCrunch Hackathon 2013. Available live on
PHP
2
star
43

suuchi-sharding-talk

References to Suuchi - Application layer Sharding Talk
2
star
44

gcloud-proxy-cors

Nginx based reverse proxy for accessing Google Cloud Service(s) with CORS Headers.
Dockerfile
2
star
45

sudarshana

Go
2
star
46

pavithra-resume

Latex source for Pavithra's Resume
TeX
2
star
47

lucene-example

Java
1
star
48

expiry-replay-simulator

HTML
1
star
49

licensd-server

Go
1
star
50

gocd-ci

GoCD-CI helps you build your projects using a .gocd-ci.yml file.
Go
1
star
51

suuchi-getting-started

Example repository to get started on Suuchi
Scala
1
star
52

docker-gocd-agent-jdk-aws-maven-sbt

GoCD Agent docker image based on alpine linux and JDK8
1
star
53

wasp-cli

Command line tool for accessing/manipulating Wasp settings
Go
1
star
54

jets3t

Java
1
star
55

structured-wiki-search

Hack done during Wikipedia Hack at Chennai
PHP
1
star
56

imgraph

Nothing fancy here yet
Scala
1
star
57

suuchi-talk

References to Suuchi Talk
1
star
58

cv2-pipe-detection

Experiment to determine if we count items in an image
Jupyter Notebook
1
star
59

devmerge-2017

Alexa Skill to quiz you on GATE syllabus computer science topics
JavaScript
1
star
60

expiry-sim-data-generator

Backtesting framework for playing around with Nifty and Banknifty
Go
1
star
61

git-cmd

Common module that all Go CD plugins to poll Git repository can use.
Java
1
star
62

maven-cache

maven-cache
Shell
1
star
63

install-golang

Scripts to install golang in containers (esp. during builds)
Shell
1
star
64

homebrew-tap

Homebrew formulas to some of my projects
Ruby
1
star
65

uClassify-scala

Scala client for uClassify.com API
Scala
1
star
66

docker-gocd-agent

Fork of travix/gocd-agent but available on public
1
star
67

ketai

Clone of http://code.google.com/p/ketai/ and more features
Java
1
star
68

chitragupta

Track all your expenses, goals and savings
Go
1
star
69

docker-gocd-agent-jdk-aws

GoCD Agent docker image based on alpine linux and JDK8
1
star
70

pdf2txt

PDF to TXT conversion that preserves the layout on best effort basis
HTML
1
star