pkg

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledRegexes

type CompiledRegexes map[*regexp.Regexp]string

type Configuration

type Configuration struct {
	Replacements []struct {
		Pattern     string `yaml:"pattern"`
		Replacement string `yaml:"replacement"`
	} `yaml:"replacements"`
	Rules []struct {
		Name        string      `yaml:"name"`
		Description string      `yaml:"description"`
		Producer    string      `yaml:"producer"`
		Template    string      `yaml:"template"`
		ContentRule ContentRule `yaml:"contentRule"`
	} `yaml:"rules"`
	ParsedTemplates ParsedTemplates
	CompiledRegexes CompiledRegexes
}

func (*Configuration) Warmup

func (c *Configuration) Warmup() error

Warmup parses templates and compiles regex

type ContentRule

type ContentRule struct {
	Key    string `yaml:"key"`
	Equals string `yaml:"equals"`
}

type Handler

type Handler struct {
	Logger *zap.Logger
	Cfg    Configuration
	IRC    *irc.Connection
	Token  string
	Cache  *cache.Cache
}

func (*Handler) MessageHandler

func (h *Handler) MessageHandler(c *gin.Context)

type MsgIn

type MsgIn map[string]interface{}

type ParsedTemplates

type ParsedTemplates map[string]map[ContentRule]*template.Template

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL