Documentation ¶
Index ¶
- func IsRunning(owner user.User) (bool, error)
- func YieldGiveawayByMatch(match bson.M, limit int64) (giveaways chan Giveaways)
- func YieldRepliesByMatch(match bson.M, limit int64) (replies chan Replies)
- type Giveaway
- func (g *Giveaway) ClearReplies() error
- func (g *Giveaway) Close() error
- func (g *Giveaway) Complete() error
- func (r *Giveaway) Create() error
- func (g *Giveaway) Delete() error
- func (g *Giveaway) EmbedTweet() error
- func (g *Giveaway) Find() error
- func (g *Giveaway) FindByTweet() error
- func (g *Giveaway) InboxForReward(user user.User)
- func (g *Giveaway) ReplyInBatch() error
- func (g *Giveaway) Replyies() error
- func (g *Giveaway) Reward() error
- func (g *Giveaway) Save() error
- func (g *Giveaway) SaveReply(reply *typing.Reply) error
- type Giveaways
- type Replies
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func YieldGiveawayByMatch ¶
Types ¶
type Giveaway ¶
type Giveaway struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Author user.User `json:"author"` Active bool `json:"active" bson:"active"` Replies []typing.Reply `json:"replies" bson:"replies"` Winners []string `json:"winners" bson:"winners"` TotalReplies int `json:"total_replies" bson:"total_replies"` Completed bool `json:"completed" bson:"completed"` Tweet string `json:"tweet" bson:"tweet"` TweetID string `json:"tweet_id" bson:"tweet_id"` TwitterURL string `json:"twitter_url" bson:"twitter_url"` TwitterHTML string `json:"twitter_html" bson:"twitter_html"` Rewarded bool `json:"rewarded" bson:"rewarded"` ReportTweet string `json:"report_tweet" bson:"report_tweet"` WinnersTweet []string `json:"winners_tweet" bson:"winners_tweet"` AmountSpent float64 `json:"amount_spent" bson:"amount_spent"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` CompletedAt time.Time `json:"completed_at" bson:"completed_at"` }
func (*Giveaway) ClearReplies ¶
ClearReplies clears replies for a giveaway
func (*Giveaway) EmbedTweet ¶
EmbedTweet embeds a tweet in the giveaway
func (*Giveaway) FindByTweet ¶
FindByTweet finds a giveaway by tweet id
func (*Giveaway) InboxForReward ¶
InboxForReward sends a message to the giveaway winners
func (*Giveaway) ReplyInBatch ¶
ReplyInBatch saves replies in batch
type Giveaways ¶
type Giveaways []Giveaway
func (*Giveaways) FindGiveawaysByMatch ¶
FindGiveawaysByMatch finds giveaways by match
type Report ¶
type Report struct { TotalReplies int `json:"total_replies"` TotalDuplicates int `json:"total_duplicates"` DuplicateReplies map[string]string `json:"duplicate_replies"` TotalValidReplies int `json:"total_valid_replies"` ValidReplies map[string]string `json:"valid_replies"` ValidRepliesList []string `json:"valid_replies_list"` }
Click to show internal directories.
Click to hide internal directories.