Documentation
¶
Index ¶
- Constants
- type SendTweet
- type TwitterBot
- func (t *TwitterBot) AddKey(key string)
- func (t *TwitterBot) AddSlashKey(key string)
- func (t *TwitterBot) Login() (*anaconda.User, error)
- func (t *TwitterBot) NextError() error
- func (t *TwitterBot) Run() error
- func (t *TwitterBot) SetBufferSizeBytes(i int64)
- func (t *TwitterBot) SetBufferSizeGBytes(i int64)
- func (t *TwitterBot) SetSendTweet(s SendTweet)
- type TwitterBotCredentials
Constants ¶
const DefaultBufferSizeBytes int64 = 1024 * 1024 * 1024 * 2
DefaultBufferSizeBytes is the default buffer size to use 1024 * 1024 * 1024 * 2 = 2Gb (<-- This is huge)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SendTweet ¶
type SendTweet func(api *anaconda.TwitterApi, tweet anaconda.Tweet) error
SendTweet is the function type that will be executed for each TwitterBot instance
type TwitterBot ¶
type TwitterBot struct {
// contains filtered or unexported fields
}
TwitterBot is used to listen for strings on Twitter and respond by calling an associated SendTweet function
func NewTwitterBot ¶
func NewTwitterBot(c *TwitterBotCredentials) *TwitterBot
NewTwitterBot is used to build a new TwitterBot
func (*TwitterBot) AddSlashKey ¶
func (t *TwitterBot) AddSlashKey(key string)
AddSlashKey is used to take a string "meeps" and search Twitter for "/meeps" add a command string without the slash.
func (*TwitterBot) NextError ¶
func (t *TwitterBot) NextError() error
NextError is just like a Next() function and will just pop the next error of the queue
Note: Not calling this message is dangerous as eventually the buffer will fill up, and messages will be dropped
func (*TwitterBot) Run ¶
func (t *TwitterBot) Run() error
Run will start the bot concurrently, and return an error if the bot cannot start
func (*TwitterBot) SetBufferSizeBytes ¶
func (t *TwitterBot) SetBufferSizeBytes(i int64)
SetBufferSizeGBytes will set the buffer size in B
func (*TwitterBot) SetBufferSizeGBytes ¶
func (t *TwitterBot) SetBufferSizeGBytes(i int64)
SetBufferSizeGBytes will set the buffer size in Gb
func (*TwitterBot) SetSendTweet ¶
func (t *TwitterBot) SetSendTweet(s SendTweet)
SetSendTweet will set a bot's SendTweet function
type TwitterBotCredentials ¶
type TwitterBotCredentials struct {
// contains filtered or unexported fields
}
TwitterBotCredentials is just an unexported wrapper for Twitter auth material
func NewTwitterBotCredentials ¶
func NewTwitterBotCredentials(accessToken, accessSecret, consumerKey, consumerSecret string) *TwitterBotCredentials
NewTwitterBotCredentials returns a package safe auth struct
func NewTwitterBotCredentialsFromEnvironmentalVariables ¶
func NewTwitterBotCredentialsFromEnvironmentalVariables() *TwitterBotCredentials
NewTwitterBotCredentialsFromEnvironmentalVariables will read from the associated environmental variables regardless if they are set.