chats

package
v1.3.91 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Slack = "slack"
	Irc   = "irc"
)

Variables

View Source
var (
	ChatKinds = []string{Slack, Irc}
)

Functions

func ProviderAccessTokenURL

func ProviderAccessTokenURL(kind string, url string) string

Types

type ChannelMetrics

type ChannelMetrics struct {
	ID          string
	Name        string
	URL         string
	MemberCount int
	Members     []string
}

ChannelMetrics metrics for a channel

func (*ChannelMetrics) ToMarkdown

func (m *ChannelMetrics) ToMarkdown() string

type ChatProvider

type ChatProvider interface {
	GetChannelMetrics(name string) (*ChannelMetrics, error)
}

CreateChatProvider represents an integration interface to chat

func CreateChatProvider

func CreateChatProvider(kind string, server *auth.AuthServer, userAuth *auth.UserAuth, batchMode bool) (ChatProvider, error)

CreateChatProvider creates a new chat provider if one is availabe for the given kind

func CreateSlackChatProvider

func CreateSlackChatProvider(server *auth.AuthServer, userAuth *auth.UserAuth, batchMode bool) (ChatProvider, error)

type SlackChatProvider

type SlackChatProvider struct {
	SlackClient *slack.Client
	Server      *auth.AuthServer
	UserAuth    *auth.UserAuth
}

func (*SlackChatProvider) GetChannelMetrics

func (c *SlackChatProvider) GetChannelMetrics(name string) (*ChannelMetrics, error)

Jump to

Keyboard shortcuts

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