slack

package module
v0.0.0-...-1f9e165 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2016 License: MPL-2.0 Imports: 6 Imported by: 0

README

Codeship Status for AreaHQ/go-slack

Go Slack

A simple Golang SDK for Slack.

Usage

package main

import (
	"log"

	slack "github.com/AreaHQ/go-slack"
)

func main() {
	cnf := &slack.Config{IncomingWebhook: "incoming_webhook"}
	adapter := slack.NewAdapter(cnf)
	err = adapter.SendMessage(
		"#some-channel",
		"some-username",
		"message to send",
		"", // emmoji
	)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter ...

func NewAdapter

func NewAdapter(cnf *Config) *Adapter

NewAdapter starts a new Adapter instance

func (*Adapter) SendMessage

func (a *Adapter) SendMessage(channel, username, text, emoji string) error

SendMessage pushes a message to one of Slack's channels

type AdapterInterface

type AdapterInterface interface {
	// Exported methods
	SendMessage(channel, username, text, emoji string) error
}

AdapterInterface defines exported methods

type AdapterMock

type AdapterMock struct {
	mock.Mock
}

AdapterMock is a mocked object implementing AdapterInterface

func (*AdapterMock) SendMessage

func (_m *AdapterMock) SendMessage(channel string, username string, text string, emoji string) error

SendMessage ...

type Config

type Config struct {
	IncomingWebhook string
}

Config stores Slack configuration options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL