Documentation
¶
Index ¶
- Constants
- func HashBytes(b []byte) string
- type AvatarMatcher
- type Engine
- func (e *Engine) ExportPlayers(listName string, w io.Writer) error
- func (e *Engine) ExportRules(listName string, w io.Writer) error
- func (e *Engine) FindNewestEntries(max int, validAttrs []string) steamid.Collection
- func (e *Engine) ImportPlayers(list *PlayerListSchema) (int, error)
- func (e *Engine) ImportRules(list *RuleSchema) (int, error)
- func (e *Engine) Mark(opts MarkOpts) error
- func (e *Engine) MatchMessage(text string) *MatchResult
- func (e *Engine) MatchName(name string) *MatchResult
- func (e *Engine) MatchSteam(steamID steamid.SID64) *MatchResult
- func (e *Engine) UniqueTags() []string
- func (e *Engine) Unmark(steamID steamid.SID64) bool
- type MarkOpts
- type MatchResult
- type PlayerListSchema
- type RuleSchema
- type SteamIDMatcher
- type TextMatcher
Constants ¶
View Source
const ( LocalRuleName = "local" LocalRuleAuthor = "local" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AvatarMatcher ¶
type AvatarMatcher interface { Match(hexDigest string) *MatchResult Type() avatarMatchType }
AvatarMatcher provides an interface to match avatars using custom methods
type Engine ¶
func New ¶ added in v0.0.6
func New(localRules *RuleSchema, localPlayers *PlayerListSchema) (*Engine, error)
func (*Engine) ExportPlayers ¶
ExportPlayers writes the json encoded player list matching the listName provided to the io.Writer
func (*Engine) ExportRules ¶
ExportRules writes the json encoded rules list matching the listName provided to the io.Writer
func (*Engine) FindNewestEntries ¶ added in v0.0.8
func (e *Engine) FindNewestEntries(max int, validAttrs []string) steamid.Collection
func (*Engine) ImportPlayers ¶
func (e *Engine) ImportPlayers(list *PlayerListSchema) (int, error)
ImportPlayers loads the provided player list for matching
func (*Engine) ImportRules ¶
func (e *Engine) ImportRules(list *RuleSchema) (int, error)
ImportRules loads the provided ruleset for use
func (*Engine) MatchMessage ¶
func (e *Engine) MatchMessage(text string) *MatchResult
func (*Engine) MatchName ¶
func (e *Engine) MatchName(name string) *MatchResult
func (*Engine) MatchSteam ¶
func (e *Engine) MatchSteam(steamID steamid.SID64) *MatchResult
func (*Engine) UniqueTags ¶
UniqueTags returns a list of the unique known tags across all player lists
type MatchResult ¶
type PlayerListSchema ¶
type PlayerListSchema struct { Players []playerDefinition `json:"players"` // contains filtered or unexported fields }
func NewPlayerListSchema ¶
func NewPlayerListSchema(players ...playerDefinition) PlayerListSchema
type RuleSchema ¶
type RuleSchema struct { Rules []ruleDefinition `json:"rules" yaml:"rules"` // contains filtered or unexported fields }
func NewRuleSchema ¶
func NewRuleSchema(rules ...ruleDefinition) RuleSchema
type SteamIDMatcher ¶
type SteamIDMatcher interface {
Match(sid64 steamid.SID64) *MatchResult
}
SteamIDMatcher provides a basic interface to match steam ids.
type TextMatcher ¶
type TextMatcher interface { // Match performs a text based match Match(text string) *MatchResult Type() textMatchType }
TextMatcher provides an interface to build text based matchers for names or in game messages
Click to show internal directories.
Click to hide internal directories.