Documentation ¶
Index ¶
- Constants
- Variables
- type Attachment
- type BlockMapReducer
- func (reducer *BlockMapReducer) BlockRange() (from, to uint32)
- func (reducer *BlockMapReducer) Initialise(client *rpc.Client) (interface{}, error)
- func (reducer *BlockMapReducer) Map(client *rpc.Client, emit func(interface{}) error, block *rpc.Block) error
- func (reducer *BlockMapReducer) ProcessResults(_acc interface{}, nextBlockToProcess uint32) error
- func (reducer *BlockMapReducer) Reduce(client *rpc.Client, _acc, _next interface{}) (interface{}, error)
- type Command
- type CommandNotifier
- type CommandNotifierConfig
- type CommentEvent
- type CommentVoteEvent
- type CommentVotesEventMiner
- type CommentsEventMiner
- type Config
- type EmailNotifier
- type EmailNotifierConfig
- type EventMiner
- type Field
- type Notifier
- type Payload
- type SlackNotifier
- type SlackNotifierConfig
- type StoriesEventMiner
- type StoryEvent
- type StoryVoteEvent
- type StoryVotesEventMiner
- type StringSet
- type WatchCommentVotesConfig
- type WatchCommentsConfig
- type WatchStoriesConfig
- type WatchStoryVotesConfig
Constants ¶
View Source
const ConfigFilename = "config.yml"
View Source
const DataDirectoryEnvironmentKey = "STEEMREDUCE_PARAMS_DATA_DIR"
View Source
const Id = "notifications"
Variables ¶
View Source
var DefaultDataDirectoryPath = filepath.Join("steemreduce_data", Id)
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Fallback string `json:"fallback"` Color string `json:"color,omitempty"` Pretext string `json:"pretext,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Text string `json:"text,omitempty"` Fields []*Field `json:"fields,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` Timestamp uint64 `json:"ts,omitempty"` }
type BlockMapReducer ¶
type BlockMapReducer struct {
// contains filtered or unexported fields
}
BlockMapReducer implements runner.BlockMapReducer interface.
func NewBlockMapReducer ¶
func NewBlockMapReducer() *BlockMapReducer
func (*BlockMapReducer) BlockRange ¶
func (reducer *BlockMapReducer) BlockRange() (from, to uint32)
func (*BlockMapReducer) Initialise ¶
func (reducer *BlockMapReducer) Initialise(client *rpc.Client) (interface{}, error)
func (*BlockMapReducer) Map ¶
func (reducer *BlockMapReducer) Map(client *rpc.Client, emit func(interface{}) error, block *rpc.Block) error
Map in this case emits a value for every story operation by the given author.
func (*BlockMapReducer) ProcessResults ¶
func (reducer *BlockMapReducer) ProcessResults(_acc interface{}, nextBlockToProcess uint32) error
type CommandNotifier ¶
type CommandNotifier struct {
// contains filtered or unexported fields
}
func NewCommandNotifier ¶
func NewCommandNotifier(config *CommandNotifierConfig) (*CommandNotifier, error)
func (*CommandNotifier) DispatchNotification ¶
func (notifier *CommandNotifier) DispatchNotification(event interface{}) error
type CommandNotifierConfig ¶
type CommandNotifierConfig struct { Stories *Command `yaml:"stories"` StoryVotes *Command `yaml:"story_votes"` Comments *Command `yaml:"comments"` CommentVotes *Command `yaml:"comment_votes"` }
func (*CommandNotifierConfig) Validate ¶
func (config *CommandNotifierConfig) Validate() error
type CommentEvent ¶
type CommentEvent struct { Op *rpc.CommentOperation Content *rpc.Content }
type CommentVoteEvent ¶
type CommentVoteEvent struct { Op *rpc.VoteOperation Content *rpc.Content }
type CommentVotesEventMiner ¶
type CommentVotesEventMiner struct {
// contains filtered or unexported fields
}
type CommentsEventMiner ¶
type CommentsEventMiner struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { Watch struct { Stories WatchStoriesConfig `yaml:"stories"` StoryVotes WatchStoryVotesConfig `yaml:"story_votes"` Comments WatchCommentsConfig `yaml:"comments"` CommentVotes WatchCommentVotesConfig `yaml:"comment_votes"` } `yaml:"watch"` EnabledNotifications []string `yaml:"enabled_notifications"` Command *CommandNotifierConfig `yaml:"command"` Email *EmailNotifierConfig `yaml:"email"` Slack *SlackNotifierConfig `yaml:"slack"` }
type EmailNotifier ¶
type EmailNotifier struct {
// contains filtered or unexported fields
}
func NewEmailNotifier ¶
func NewEmailNotifier(config *EmailNotifierConfig) (*EmailNotifier, error)
func (*EmailNotifier) DispatchNotification ¶
func (notifier *EmailNotifier) DispatchNotification(event interface{}) error
type EmailNotifierConfig ¶
type EmailNotifierConfig struct { SMTPServerHost string `yaml:"smtp_server_host"` SMTPServerPort int `yaml:"smtp_server_port"` SMTPUsername string `yaml:"smtp_username"` SMTPPassword string `yaml:"smtp_password"` From string `yaml:"from"` To []string `yaml:"to"` }
func (*EmailNotifierConfig) Validate ¶
func (config *EmailNotifierConfig) Validate() error
type EventMiner ¶
type Payload ¶
type Payload struct { Text string `json:"text,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` }
type SlackNotifier ¶
type SlackNotifier struct {
// contains filtered or unexported fields
}
func NewSlackNotifier ¶
func NewSlackNotifier(config *SlackNotifierConfig) (*SlackNotifier, error)
func (*SlackNotifier) DispatchNotification ¶
func (notifier *SlackNotifier) DispatchNotification(event interface{}) error
type SlackNotifierConfig ¶
type SlackNotifierConfig struct {
WebhookURL string `yaml:"webhook_url"`
}
func (*SlackNotifierConfig) Validate ¶
func (config *SlackNotifierConfig) Validate() error
type StoriesEventMiner ¶
type StoriesEventMiner struct {
// contains filtered or unexported fields
}
type StoryEvent ¶
type StoryEvent struct { Op *rpc.CommentOperation Content *rpc.Content }
type StoryVoteEvent ¶
type StoryVoteEvent struct { Op *rpc.VoteOperation Content *rpc.Content }
type StoryVotesEventMiner ¶
type StoryVotesEventMiner struct {
// contains filtered or unexported fields
}
type WatchCommentVotesConfig ¶
type WatchCommentsConfig ¶
type WatchStoriesConfig ¶
type WatchStoryVotesConfig ¶
Click to show internal directories.
Click to hide internal directories.