Help us shape the future of Go! Take the 2026 Go Developer Survey

slack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EnvToken = "SLACK_TOKEN"

EnvToken is Slack API Token

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	ChatPostMessage(ctx context.Context, attachments []*objects.Attachment) (*objects.ChatResponse, error)
}

API is Slack API interface

type Client

type Client struct {
	*slack.Client

	Config Config

	Notify *NotifyService

	API API
	// contains filtered or unexported fields
}

Client is a API client for Slack

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient returns Client initialized with Config

type Config

type Config struct {
	Token    string
	Channel  string
	Botname  string
	Message  string
	CI       string
	Parser   terraform.Parser
	Template terraform.Template
}

Config is a configuration for GitHub client

type NotifyService

type NotifyService service

NotifyService handles communication with the notification related methods of Slack API

func (*NotifyService) Notify

func (s *NotifyService) Notify(body string) (exit int, err error)

Notify posts comment optimized for notifications

type Slack

type Slack struct {
	*slack.Client
	Channel string
	Botname string
}

Slack represents the attribute information necessary for requesting Slack API

func (*Slack) ChatPostMessage

func (s *Slack) ChatPostMessage(ctx context.Context, attachments []*objects.Attachment) (*objects.ChatResponse, error)

ChatPostMessage is a wrapper of https://godoc.org/github.com/lestrrat-go/slack#ChatPostMessageCall

Jump to

Keyboard shortcuts

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