Documentation ¶
Index ¶
- Constants
- Variables
- func NewRSSModule(t marvin.Team) marvin.Module
- type FacebookError
- type FacebookFeed
- type FacebookFeedDataItem
- type FacebookType
- func (t *FacebookType) Client() (marvin.HTTPDoer, error)
- func (t *FacebookType) Domains() []string
- func (t *FacebookType) LoadFeed(ctx context.Context, feedID string, lastSeen string) (FeedMeta, []Item, error)
- func (t *FacebookType) Name() string
- func (t *FacebookType) OAuthConfig() (clientcredentials.Config, error)
- func (t *FacebookType) OnLoad(mod *RSSModule)
- func (t *FacebookType) TypeID() TypeID
- func (t *FacebookType) VerifyFeedIdentifier(ctx context.Context, input string) (string, error)
- type FeedMeta
- type FeedType
- type Item
- type PHPTime
- type RSSModule
- func (mod *RSSModule) CommandList(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
- func (mod *RSSModule) CommandRemove(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
- func (mod *RSSModule) CommandSubscribe(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
- func (mod *RSSModule) Config() marvin.ModuleConfig
- func (mod *RSSModule) DB() *db
- func (mod *RSSModule) Disable(t marvin.Team)
- func (mod *RSSModule) Enable(t marvin.Team)
- func (mod *RSSModule) GetFeedType(i TypeID) FeedType
- func (mod *RSSModule) GetFeedTypeName(i TypeID) string
- func (mod *RSSModule) Identifier() marvin.ModuleID
- func (mod *RSSModule) Load(t marvin.Team)
- type TwitterError
- type TwitterFeed
- type TwitterFeedDataItem
- type TwitterType
- func (t *TwitterType) Client() (marvin.HTTPDoer, error)
- func (t *TwitterType) Domains() []string
- func (t *TwitterType) LoadFeed(ctx context.Context, feedID string, lastSeen string) (FeedMeta, []Item, error)
- func (t *TwitterType) Name() string
- func (t *TwitterType) OnLoad(mod *RSSModule)
- func (t *TwitterType) TypeID() TypeID
- func (t *TwitterType) VerifyFeedIdentifier(ctx context.Context, input string) (string, error)
- type TypeID
Constants ¶
View Source
const Identifier = "rss"
Variables ¶
View Source
var ErrNotConfigured = errors.New("Feed type not configured")
Functions ¶
Types ¶
type FacebookError ¶
type FacebookFeed ¶
type FacebookFeed struct { Name string Link string Feed struct { Data []FacebookFeedDataItem } ID string }
func (*FacebookFeed) FeedID ¶
func (f *FacebookFeed) FeedID() string
type FacebookFeedDataItem ¶
type FacebookFeedDataItem struct { Message string `json:"message"` Story string `json:"story"` Description string `json:"description"` PermalinkURL string `json:"permalink_url"` CreatedTime PHPTime `json:"created_time"` FullPicture string `json:"full_picture"` From struct { Name string `json:"name"` } `json:"from"` ID string `json:"id"` }
func (FacebookFeedDataItem) ItemID ¶
func (i FacebookFeedDataItem) ItemID() string
func (FacebookFeedDataItem) Render ¶
func (i FacebookFeedDataItem) Render(p FeedMeta) slack.OutgoingSlackMessage
type FacebookType ¶
type FacebookType struct {
// contains filtered or unexported fields
}
func (*FacebookType) Domains ¶
func (t *FacebookType) Domains() []string
func (*FacebookType) Name ¶
func (t *FacebookType) Name() string
func (*FacebookType) OAuthConfig ¶
func (t *FacebookType) OAuthConfig() (clientcredentials.Config, error)
func (*FacebookType) OnLoad ¶
func (t *FacebookType) OnLoad(mod *RSSModule)
func (*FacebookType) TypeID ¶
func (t *FacebookType) TypeID() TypeID
func (*FacebookType) VerifyFeedIdentifier ¶
type FeedMeta ¶
type FeedMeta interface {
FeedID() string
}
FeedMeta is a flag interface for information shared between multiple feed items.
type FeedType ¶
type FeedType interface { // Return the type ID used in the database TypeID() TypeID // Preferred user-visible name of the feed type Name() string // OnLoad sets up the ModuleConfig keys. OnLoad(mod *RSSModule) // Domains gives a list of domains on which this module has priority. Domains() []string // VerifyFeedIdentifier parses a command input into a canonical feed ID, // and checks whether the feed in fact exists at all. // If config keys are missing, it returns ErrNotConfigured. VerifyFeedIdentifier(ctx context.Context, input string) (string, error) // LoadFeed pulls the current content of the given feed. LoadFeed(ctx context.Context, feedID string, lastSeen string) (FeedMeta, []Item, error) }
FeedType is the basic polymorphism type of the RSS module.
type Item ¶
type Item interface { ItemID() string Render(FeedMeta) slack.OutgoingSlackMessage }
An Item is something that has a per-feed item ID and can be rendered into a Slack message.
type PHPTime ¶
func (*PHPTime) UnmarshalJSON ¶
type RSSModule ¶
type RSSModule struct {
// contains filtered or unexported fields
}
func (*RSSModule) CommandList ¶
func (mod *RSSModule) CommandList(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
func (*RSSModule) CommandRemove ¶
func (mod *RSSModule) CommandRemove(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
func (*RSSModule) CommandSubscribe ¶
func (mod *RSSModule) CommandSubscribe(t marvin.Team, args *marvin.CommandArguments) marvin.CommandResult
func (*RSSModule) Config ¶
func (mod *RSSModule) Config() marvin.ModuleConfig
func (*RSSModule) GetFeedType ¶
func (*RSSModule) GetFeedTypeName ¶
func (*RSSModule) Identifier ¶
type TwitterError ¶
type TwitterError struct { ResponseCode int `json:"-"` Errors []struct { Message string `json:"message"` Code int `json:"code"` } `json:"errors"` }
func (TwitterError) Error ¶
func (e TwitterError) Error() string
type TwitterFeed ¶
type TwitterFeed struct { FeedLogin string // contains filtered or unexported fields }
func (*TwitterFeed) FeedID ¶
func (f *TwitterFeed) FeedID() string
type TwitterFeedDataItem ¶
func (TwitterFeedDataItem) ItemID ¶
func (i TwitterFeedDataItem) ItemID() string
func (TwitterFeedDataItem) Render ¶
func (i TwitterFeedDataItem) Render(p FeedMeta) slack.OutgoingSlackMessage
type TwitterType ¶
type TwitterType struct {
// contains filtered or unexported fields
}
func (*TwitterType) Domains ¶
func (t *TwitterType) Domains() []string
func (*TwitterType) Name ¶
func (t *TwitterType) Name() string
func (*TwitterType) OnLoad ¶
func (t *TwitterType) OnLoad(mod *RSSModule)
func (*TwitterType) TypeID ¶
func (t *TwitterType) TypeID() TypeID
func (*TwitterType) VerifyFeedIdentifier ¶
Click to show internal directories.
Click to hide internal directories.