Documentation
¶
Index ¶
- type BitbucketProvider
- type Client
- func (c *Client) MentionReply(source *pb.ChannelSource, msg string) error
- func (c *Client) MentionReplyf(source *pb.ChannelSource, format string, args ...interface{}) error
- func (c *Client) Register(p Provider)
- func (c *Client) Reply(source *pb.ChannelSource, msg string) error
- func (c *Client) Replyf(source *pb.ChannelSource, format string, args ...interface{}) error
- func (c *Client) Run() error
- type GithubProvider
- type MessageCallback
- type Provider
- type RedditProvider
- type SpotifyProvider
- type TwitterProvider
- type URLCallback
- type XKCDProvider
- type YoutubeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitbucketProvider ¶
type BitbucketProvider struct{}
func NewBitbucketProvider ¶
func NewBitbucketProvider() *BitbucketProvider
func (*BitbucketProvider) GetCallbacks ¶
func (p *BitbucketProvider) GetCallbacks() map[string]URLCallback
func (*BitbucketProvider) GetMessageCallback ¶
func (p *BitbucketProvider) GetMessageCallback() MessageCallback
type Client ¶
func (*Client) MentionReply ¶
func (c *Client) MentionReply(source *pb.ChannelSource, msg string) error
func (*Client) MentionReplyf ¶
func (c *Client) MentionReplyf(source *pb.ChannelSource, format string, args ...interface{}) error
func (*Client) Reply ¶
func (c *Client) Reply(source *pb.ChannelSource, msg string) error
TODO: currently Reply in seabird-go doesn't expose tags, so we copy all the Reply variants here and make sure to set the proper tags.
type GithubProvider ¶
type GithubProvider struct {
// contains filtered or unexported fields
}
func NewGithubProvider ¶
func NewGithubProvider(token string) *GithubProvider
func (*GithubProvider) GetCallbacks ¶
func (p *GithubProvider) GetCallbacks() map[string]URLCallback
func (*GithubProvider) GetMessageCallback ¶
func (p *GithubProvider) GetMessageCallback() MessageCallback
type MessageCallback ¶
type MessageCallback func(c *Client, source *pb.ChannelSource, text string)
MessageCallback is a callback to be registered with the Client. It takes an event and allows the callback to do what it needs. Note that if any network calls need to be made it is recommended to do that in a goroutine.
type Provider ¶
type Provider interface { GetCallbacks() map[string]URLCallback GetMessageCallback() MessageCallback }
type RedditProvider ¶
type RedditProvider struct{}
func NewRedditProvider ¶
func NewRedditProvider() *RedditProvider
func (*RedditProvider) GetCallbacks ¶
func (p *RedditProvider) GetCallbacks() map[string]URLCallback
func (*RedditProvider) GetMessageCallback ¶
func (p *RedditProvider) GetMessageCallback() MessageCallback
type SpotifyProvider ¶
type SpotifyProvider struct {
// contains filtered or unexported fields
}
func NewSpotifyProvider ¶
func NewSpotifyProvider(clientID, clientSecret string) (*SpotifyProvider, error)
func (*SpotifyProvider) GetCallbacks ¶
func (p *SpotifyProvider) GetCallbacks() map[string]URLCallback
func (*SpotifyProvider) GetMessageCallback ¶
func (p *SpotifyProvider) GetMessageCallback() MessageCallback
type TwitterProvider ¶
type TwitterProvider struct {
// contains filtered or unexported fields
}
func NewTwitterProvider ¶
func NewTwitterProvider(consumerKey, consumerSecret, accessToken, accessTokenSecret string) *TwitterProvider
func (*TwitterProvider) GetCallbacks ¶
func (p *TwitterProvider) GetCallbacks() map[string]URLCallback
func (*TwitterProvider) GetMessageCallback ¶
func (p *TwitterProvider) GetMessageCallback() MessageCallback
type URLCallback ¶
URLCallback is a callback to be registered with the Client. It takes a *url.URL representing the found url. It returns true if it was able to handle that url and false otherwise.
type XKCDProvider ¶
type XKCDProvider struct{}
func NewXKCDProvider ¶
func NewXKCDProvider() *XKCDProvider
func (*XKCDProvider) GetCallbacks ¶
func (p *XKCDProvider) GetCallbacks() map[string]URLCallback
func (*XKCDProvider) GetMessageCallback ¶
func (p *XKCDProvider) GetMessageCallback() MessageCallback
type YoutubeProvider ¶
type YoutubeProvider struct {
// contains filtered or unexported fields
}
func NewYoutubeProvider ¶
func NewYoutubeProvider(token string) *YoutubeProvider
func (*YoutubeProvider) GetCallbacks ¶
func (p *YoutubeProvider) GetCallbacks() map[string]URLCallback
func (*YoutubeProvider) GetMessageCallback ¶
func (p *YoutubeProvider) GetMessageCallback() MessageCallback
Source Files
¶
Click to show internal directories.
Click to hide internal directories.