Documentation ¶
Index ¶
- Constants
- type Alert
- type Alerts
- type CapsFilter
- type Channel
- func (c *Channel) Create(ctx context.Context) error
- func (c *Channel) Delete(ctx context.Context) error
- func (c *Channel) LoadByChannelId(ctx context.Context, channelId string) error
- func (c *Channel) LoadByChannelName(ctx context.Context, name string) error
- func (c *Channel) LoadBylId(ctx context.Context, id primitive.ObjectID) error
- func (c *Channel) Update(ctx context.Context) error
- type Command
- type CommandList
- type EmojisFilter
- type EmotesFilter
- type EnglishFilter
- type FilterCommon
- type Filters
- type JWT
- type LengthFilter
- type LinkFilter
- type Purge
- type RepetitionFilter
- type Session
- type SoloSpamFilter
- type SymbolsFilter
- type User
- type ZalgoFilter
Constants ¶
View Source
const (
SessionIdKey = "sid"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alerts ¶
type Alerts struct { dataful.BaseModel `bson:",inline"` Channel primitive.ObjectID `bson:"channel" json:"channel"` Sub Alert `bson:"sub" json:"sub"` Resub Alert `bson:"resub" json:"resub"` SubGift Alert `bson:"subGift" json:"subGift"` CommunityGift Alert `bson:"communityGift" json:"communityGift"` Follow Alert `bson:"follow" json:"follow"` Raid Alert `bson:"raid" json:"raid"` Bits Alert `bson:"bits" json:"bits"` }
func NewAlerts ¶
func NewAlerts(r dataful.Repository) *Alerts
type CapsFilter ¶
type CapsFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` MaxCount int `bson:"maxCount" json:"maxCount"` MaxPercentage float64 `bson:"maxPercentage" json:"maxPercentage"` }
func NewCapsFilter ¶
func NewCapsFilter() CapsFilter
type Channel ¶
type Channel struct { dataful.BaseModel `bson:",inline"` ChannelId string `bson:"channelId" json:"channelId"` BroadcasterName string `bson:"broadcasterName" json:"broadcasterName"` Language string `bson:"language" json:"language"` GameId string `bson:"gameId" json:"gameId"` GameName string `bson:"gameName" json:"gameName"` Title string `bson:"title" json:"title"` Joined bool `bson:"joined" json:"joined"` Silenced bool `bson:"silenced" json:"silenced"` AccessToken string `bson:"accessToken,omitempty" json:"-"` RefreshToken string `bson:"refreshToken,omitempty" json:"-"` Prefix string `bson:"prefix" json:"prefix"` Live bool `bson:"live" json:"live"` Shard int `bson:"shard" json:"shard"` Authenticated bool `bson:"authenticated" json:"authenticated"` StartedAt time.Time `bson:"startedAt,omitempty" json:"startedAt,omitempty"` EndedAt time.Time `bson:"endedAt,omitempty" json:"endedAt,omitempty"` Moderator bool `bson:"moderator" json:"moderator"` }
func NewChannel ¶
func NewChannel(r dataful.Repository) *Channel
func (*Channel) LoadByChannelId ¶
func (*Channel) LoadByChannelName ¶
type Command ¶
type Command struct { dataful.BaseModel `bson:",inline"` Channel primitive.ObjectID `bson:"channel" json:"channel"` Name string `bson:"name" json:"name"` Enabled bool `bson:"enabled" json:"enabled"` Cooldowns embeddables.Cooldown `bson:"cooldowns" json:"cooldowns"` Role embeddables.UserRole `bson:"role" json:"role"` Stream embeddables.StreamStatus `bson:"stream" json:"stream"` Response string `bson:"response" json:"response"` Aliases []string `bson:"aliases" json:"aliases"` HasVar bool `bson:"hasVar" json:"-"` Attributes embeddables.CommandAttributes `bson:"attributes" json:"attributes"` Timer embeddables.Timer `bson:"timer" json:"timer"` }
func NewCommand ¶
func NewCommand(r dataful.Repository) *Command
type CommandList ¶
type CommandList struct { List []*Command `json:"list"` // contains filtered or unexported fields }
func NewCommandList ¶
func NewCommandList(r dataful.Repository) *CommandList
func (*CommandList) GetList ¶
func (cl *CommandList) GetList() interface{}
func (*CommandList) LoadAllByChannel ¶
LoadAllByChannel gets all commands for given channel.
func (*CommandList) Loaded ¶
func (cl *CommandList) Loaded() bool
func (*CommandList) SetLoaded ¶
func (cl *CommandList) SetLoaded()
type EmojisFilter ¶
type EmojisFilter struct { FilterCommon `bson:",inline"` MaxCount int `bson:"maxCount" json:"maxCount"` }
func NewEmojisFilter ¶
func NewEmojisFilter() EmojisFilter
type EmotesFilter ¶
type EmotesFilter struct { FilterCommon `bson:",inline"` MaxCount int `bson:"maxCount" json:"maxCount"` }
func NewEmotesFilter ¶
func NewEmotesFilter() EmotesFilter
type EnglishFilter ¶
type EnglishFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` MaxCount int `bson:"maxCount" json:"maxCount"` MaxPercentage float64 `bson:"maxPercentage" json:"maxPercentage"` }
func NewEnglishFilter ¶
func NewEnglishFilter() EnglishFilter
type FilterCommon ¶
type FilterCommon struct { Enabled bool `bson:"enabled" json:"enabled"` Description string `bson:"description" json:"description"` Stream embeddables.StreamStatus `bson:"stream" json:"stream"` DisableOnRaid bool `bson:"disableOnRaid" json:"disableOnRaid"` Announce bool `bson:"announce" json:"announce"` AnnounceCooldown int `bson:"announceCooldown" json:"announceCooldown"` Message string `bson:"message" json:"message"` TimeoutDuration int `bson:"timeoutDuration" json:"timeoutDuration"` ExponentialBase int `bson:"exponentialBase" json:"exponentialBase"` OffenseTimeout int `bson:"offenseTimeout" json:"offenseTimeout"` MaxRole embeddables.UserRole `bson:"maxRole" json:"maxRole"` }
func NewFilterCommon ¶
func NewFilterCommon(description, message string) FilterCommon
type Filters ¶
type Filters struct { dataful.BaseModel `bson:",inline"` Channel primitive.ObjectID `bson:"channel" json:"channel"` Caps CapsFilter `bson:"caps" json:"caps"` Symbols SymbolsFilter `bson:"symbols" json:"symbols"` Zalgo ZalgoFilter `bson:"zalgo" json:"zalgo"` English EnglishFilter `bson:"english" json:"english"` Length LengthFilter `bson:"length" json:"length"` Emotes EmotesFilter `bson:"emotes" json:"emotes"` Emojis EmojisFilter `bson:"emojis" json:"emojis"` SoloSpam SoloSpamFilter `bson:"soloSpam" json:"soloSpam"` Repetition RepetitionFilter `bson:"repetition" json:"repetition"` Link LinkFilter `bson:"link" json:"link"` }
func NewFilters ¶
func NewFilters(r dataful.Repository) *Filters
func (*Filters) LoadByChannel ¶
type JWT ¶
type JWT struct { SessionId string // contains filtered or unexported fields }
type LengthFilter ¶
type LengthFilter struct { FilterCommon `bson:",inline"` MaxCount int `bson:"maxCount" json:"maxCount"` }
func NewLengthFilter ¶
func NewLengthFilter() LengthFilter
type LinkFilter ¶
type LinkFilter struct { FilterCommon `bson:",inline"` Whitelist []string `bson:"whitelist" json:"whitelist"` }
func NewLinkFilter ¶
func NewLinkFilter() LinkFilter
type Purge ¶
type Purge struct { dataful.BaseModel `bson:",inline"` Channel primitive.ObjectID `bson:"channel" json:"channel"` Enabled bool `bson:"enabled" json:"enabled"` MaxRole embeddables.UserRole `bson:"maxRole" json:"maxRole"` Lookback int `bson:"lookback" json:"lookback"` Continuous bool `bson:"continuous" json:"continuous"` ContinuousTime int `bson:"continuousTime" json:"continuousTime"` }
func NewPurge ¶
func NewPurge(r dataful.Repository) *Purge
type RepetitionFilter ¶
type RepetitionFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` MaxRepetitions int `bson:"maxRepetitions" json:"maxRepetitions"` MinUnique int `bson:"minUnique" json:"minUnique"` }
func NewRepetitionFilter ¶
func NewRepetitionFilter() RepetitionFilter
type Session ¶
type Session struct { SessionId string `json:"sessionId"` User primitive.ObjectID `json:"user"` SelectedChannel primitive.ObjectID `json:"channel"` // contains filtered or unexported fields }
func NewSession ¶
func (*Session) GenerateSessionId ¶
func (s *Session) GenerateSessionId()
GenerateSessionId generates a new session uid
func (*Session) GetSession ¶
GetSession gets the session from db
type SoloSpamFilter ¶
type SoloSpamFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` Similarity float64 `bson:"similarity" json:"similarity"` MaxCount int `bson:"maxCount" json:"maxCount"` Lookback int `bson:"lookback" json:"lookback"` }
func NewSoloSpamFilter ¶
func NewSoloSpamFilter() SoloSpamFilter
type SymbolsFilter ¶
type SymbolsFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` MaxCount int `bson:"maxCount" json:"maxCount"` MaxPercentage float64 `bson:"maxPercentage" json:"maxPercentage"` }
func NewSymbolsFilter ¶
func NewSymbolsFilter() SymbolsFilter
type User ¶
type User struct { dataful.BaseModel `bson:",inline"` UserID string `bson:"userId" json:"userId"` Login string `bson:"login" json:"login"` DisplayName string `bson:"displayName" json:"displayName"` AccessToken string `bson:"accessToken" json:"-"` RefreshToken string `bson:"refreshToken" json:"-"` Type string `bson:"type" json:"type"` BroadcasterType string `bson:"broadcasterType" json:"broadcasterType"` Description string `bson:"description" json:"description"` ProfileImageURL string `bson:"profileImageURL" json:"profileImageURL"` OfflineImageURL string `bson:"offlineImageURL" json:"offlineImageURL"` ViewCount int `bson:"viewCount" json:"viewCount"` Suspended bool `bson:"suspended" json:"suspended"` Admin bool `bson:"admin" json:"admin"` Channel primitive.ObjectID `bson:"channel" json:"channel"` }
func NewUser ¶
func NewUser(r dataful.Repository) *User
type ZalgoFilter ¶
type ZalgoFilter struct { FilterCommon `bson:",inline"` MinChars int `bson:"minChars" json:"minChars"` MaxCount int `bson:"maxCount" json:"maxCount"` MaxPercentage float64 `bson:"maxPercentage" json:"maxPercentage"` }
func NewZalgoFilter ¶
func NewZalgoFilter() ZalgoFilter
Source Files ¶
Click to show internal directories.
Click to hide internal directories.