Documentation
¶
Index ¶
- Constants
- Variables
- func NewSNS(r string) *sns.SNS
- func Run(configFile string) error
- func RunIRCAgent(c *Config, ch chan IRCMessage)
- func RunMsgr(configFile string) error
- func RunSlackAgent(c *Config, ch chan SlackMessage)
- type Config
- type IRCConfig
- type IRCMessage
- type IRCMessageChan
- type MessageChan
- type SlackAgent
- type SlackConfig
- type SlackMessage
- type SlackMessageChan
Constants ¶
View Source
const (
MsgBufferLen = 100
)
View Source
const MsgrRoot = "/irc-msgr"
View Source
const Root = "/np"
View Source
const SlackMaxBackOff = 3600
Variables ¶
View Source
var ( SlackThrottleWindow = 1 * time.Second SlackInitialBackOff = 30 Epoch = time.Unix(0, 0) )
View Source
var (
IRCThrottleWindow = 1 * time.Second
)
Functions ¶
func RunIRCAgent ¶
func RunIRCAgent(c *Config, ch chan IRCMessage)
func RunSlackAgent ¶ added in v0.0.5
func RunSlackAgent(c *Config, ch chan SlackMessage)
Types ¶
type Config ¶
type Config struct { BaseURL string `yaml:"base_url"` Listen string `yaml:"listen"` DataDir string `yaml:"data_dir"` IRC *IRCConfig `yaml:"irc"` Slack *SlackConfig `yaml:"slack"` Channels []string `yaml:"channels"` // contains filtered or unexported fields }
func LoadConfig ¶
func (*Config) AddChannel ¶
func (*Config) DataFilePath ¶
func (*Config) SetFilePath ¶
type IRCMessage ¶
type IRCMessageChan ¶ added in v0.0.5
type IRCMessageChan chan IRCMessage
func (IRCMessageChan) PostMsgr ¶ added in v0.0.5
func (ch IRCMessageChan) PostMsgr(req *http.Request)
func (IRCMessageChan) PostNopaste ¶ added in v0.0.5
func (ch IRCMessageChan) PostNopaste(np nopasteContent, url string)
type MessageChan ¶ added in v0.0.5
type SlackAgent ¶ added in v0.0.5
type SlackAgent struct { WebhookURL string // contains filtered or unexported fields }
func (*SlackAgent) Post ¶ added in v0.0.5
func (a *SlackAgent) Post(m SlackMessage) error
type SlackConfig ¶ added in v0.0.5
type SlackConfig struct {
WebhookURL string `yaml:"webhook_url"`
}
type SlackMessage ¶ added in v0.0.5
type SlackMessageChan ¶ added in v0.0.5
type SlackMessageChan chan SlackMessage
func (SlackMessageChan) PostMsgr ¶ added in v0.0.5
func (ch SlackMessageChan) PostMsgr(req *http.Request)
func (SlackMessageChan) PostNopaste ¶ added in v0.0.5
func (ch SlackMessageChan) PostNopaste(np nopasteContent, url string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.