slack

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileNotFound indicates that an artifact was not found.
	ErrFileNotFound = errors.New("file not found")
	// ErrNotParsable indicates that an artifact could not be parsed against the
	// artifact specification.
	ErrNotParsable = errors.New("message not parsable")
	// ErrUnknownFields indicates that an artifact contains an unknown field.
	ErrUnknownFields = errors.New("message contains unknown fields")

	MsgColorGreen  = "#73BF69"
	MsgColorYellow = "#FADE2A"
	MsgColorRed    = "#F2495C"
)

Functions

func Persist added in v0.0.6

func Persist(path string, message Message) error

func Update added in v0.0.6

func Update(path, token string, f func(Message) Message) error

Types

type Client

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

func NewClient

func NewClient(token string) (*Client, error)

func (*Client) GetSlackIdByEmail

func (c *Client) GetSlackIdByEmail(email string) (string, error)

func (*Client) PostPrivateMessage

func (c *Client) PostPrivateMessage(userID, env, service string, artifact artifact.Spec, podNotify *http.PodNotifyRequest) error

func (*Client) PostSlackBuildStarted added in v0.0.6

func (c *Client) PostSlackBuildStarted(userId, title, text, color string) (string, string, error)

func (*Client) UpdateSlackBuildStatus added in v0.0.6

func (c *Client) UpdateSlackBuildStatus(channel, title, text, color, timestamp string) (string, string, error)

type Message added in v0.0.6

type Message struct {
	UserID    string `json:"userId,omitempty"`
	Color     string `json:"color,omitempty"`
	Channel   string `json:"channel,omitempty"`
	Text      string `json:"text,omitempty"`
	Title     string `json:"title,omitempty"`
	Timestamp string `json:"timestamp,omitempty"`
}

func Get added in v0.0.6

func Get(path string) (Message, error)

Jump to

Keyboard shortcuts

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