slack

package
v0.0.0-...-fe50fa5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Ok bool `json:"ok"`
}

type AuthResponse

type AuthResponse struct {
	Ok     bool   `json:"ok"`
	URL    string `json:"url"`
	Team   string `json:"team"`
	User   string `json:"user"`
	TeamID string `json:"team_id"`
	UserID string `json:"user_id"`
}

type Channel

type Channel struct {
	ID             string   `json:"id"`
	Name           string   `json:"name"`
	IsChannel      bool     `json:"is_channel"`
	Created        int      `json:"created"`
	Creator        string   `json:"creator"`
	IsArchived     bool     `json:"is_archived"`
	IsGeneral      bool     `json:"is_general"`
	NameNormalized string   `json:"name_normalized"`
	IsShared       bool     `json:"is_shared"`
	IsOrgShared    bool     `json:"is_org_shared"`
	IsMember       bool     `json:"is_member"`
	Members        []string `json:"members"`
	Topic          struct {
		Value   string `json:"value"`
		Creator string `json:"creator"`
		LastSet int    `json:"last_set"`
	} `json:"topic"`
	Purpose struct {
		Value   string `json:"value"`
		Creator string `json:"creator"`
		LastSet int    `json:"last_set"`
	} `json:"purpose"`
	PreviousNames []interface{} `json:"previous_names"`
	NumMembers    int           `json:"num_members"`
}

type ChannelList

type ChannelList struct {
	Ok       bool      `json:"ok"`
	Channels []Channel `json:"channels"`
}

type Client

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

Client allows you to provide connection to Slack API Server It contains a token that allows to authenticate connection to post and work with channels in the domain

func NewClient

func NewClient(token string) *Client

NewClient creates a slack client with an API token.

func NewFakeClient

func NewFakeClient() *Client

NewFakeClient returns a client that takes no actions.

func (*Client) GetChannels

func (sl *Client) GetChannels() ([]Channel, error)

func (*Client) VerifyAPI

func (sl *Client) VerifyAPI() (bool, error)

func (*Client) VerifyAuth

func (sl *Client) VerifyAuth() (bool, error)

func (*Client) WriteMessage

func (sl *Client) WriteMessage(text, channel string) error

type Logger

type Logger interface {
	Debugf(s string, v ...interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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