eg(easygoing) is a super simple and easy Slack messaging library for golang.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
doc
LICENSE
README.md
easygoing.go
easygoing_attachment.go
easygoing_test.go

README.md

eg

CircleCI

  • eg(easygoing) is a super simple and easy Slack messaging library for golang.

License

Apache 2.0
(read ./LICENSE)

Sample code

Basic Message

package main

import (
	"fmt"
	"net/http"

	"github.com/ryo-yamaoka/easygoing"
)

const (
	slackEndpoint = "https://hooks.slack.com/services/xxxxxxxxxx/yyyyyyyyyy/zzzzzzzzzz"
)

func main() {
	client := &http.Client{}
	_, err := eg.NewBasicMessage(slackEndpoint).
		Channel("").
		UserName("Mr.SoftServeIceCream").
		IconEmoji(":poop:").
		Text("This is text").
		Send(client)
	if err != nil {
		fmt.Println(err.Error())
		return
	}
}

basic

Attachment Message

package main

import (
	"fmt"
	"net/http"

	"github.com/ryo-yamaoka/easygoing"
)

const (
	slackEndpoint = "https://hooks.slack.com/services/xxxxxxxxxx/yyyyyyyyyy/zzzzzzzzzz"
)

func main() {
	client := &http.Client{}
	_, err := eg.NewAttachmentMessage(slackEndpoint).
		Channel("").
		UserName("Mr.SoftServeIceCream").
		IconEmoji(":poop:").
		Color(eg.COLOR_RED).
		Title("This is title").
		Text("This is text").
		Send(client)
	if err != nil {
		fmt.Println(err.Error())
		return
	}
}

attachment