Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRulesRequest ¶
type CreateRulesRequest struct {
Add []*RuleValue `json:"add"`
}
CreateRulesRequest is a struct used to create the payload for creating rules.
type DeleteRulesRequest ¶
type DeleteRulesRequest struct { Delete struct { Ids []int `json:"ids"` } `json:"delete"` }
DeleteRulesRequest is a struct used to create the payload for deleting rules.
func NewDeleteRulesRequest ¶
func NewDeleteRulesRequest(ids ...int) DeleteRulesRequest
NewDeleteRulesRequest will create an instance of DeleteRulesRequest.
type ErrorRule ¶
type ErrorRule struct { Value string `json:"Value"` Id string `json:"id"` Title string `json:"title"` Type string `json:"type"` }
ErrorRule is what is returned as "Errors" when adding or deleting a rule.
type IRuleBuilder ¶
type IRuleBuilder interface { AddRule(value string, tag string) *RuleBuilder Build() CreateRulesRequest }
IRuleBuilder is an interface that describers how to implement a RuleBuilder.
type IRules ¶
type IRules interface { Create(rules CreateRulesRequest, dryRun bool) (*TwitterRuleResponse, error) Delete(req DeleteRulesRequest, dryRun bool) (*TwitterRuleResponse, error) Get() (*TwitterRuleResponse, error) }
IRules is the interface the rules struct implements.
func NewRules ¶
func NewRules(httpClient httpclient.IHttpClient) IRules
NewRules creates a "rules" instance. This is used to create Twitter Filtered Stream rules. https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/build-a-rule.
type MetaRule ¶
type MetaRule struct { Sent string `json:"sent"` Summary MetaSummary `json:"summary"` }
MetaRule is what is returned as "Meta" when adding or deleting a rule.
type MetaSummary ¶
MetaSummary is what is returned as "Summary" in "Meta" when adding or deleting a rule.
type RuleBuilder ¶
type RuleBuilder struct {
// contains filtered or unexported fields
}
RuleBuilder is struct used to help create twitter stream rules.
func NewRuleBuilder ¶
func NewRuleBuilder() *RuleBuilder
NewRuleBuilder will create an instance of `RuleBuilder`.
func (*RuleBuilder) AddRule ¶
func (r *RuleBuilder) AddRule(value string, tag string) *RuleBuilder
AddRule will create a rule to be build for filtered-stream. Read more about rule limitations here https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/introduction.
func (*RuleBuilder) Build ¶
func (r *RuleBuilder) Build() CreateRulesRequest
type RuleValue ¶
RuleValue is a struct used to help create twitter stream rules. It takes in a value and a tag.
type TwitterRuleResponse ¶
TwitterRuleResponse is what is returned from twitter when adding or deleting a rule.