Categorygithub.com/webtor-io/stoplist
modulepackage
0.0.0-20230128160543-ea87bdc34deb
Repository: https://github.com/webtor-io/stoplist.git
Documentation: pkg.go.dev

# README

stoplist

Generates stoplist from YAML-format

Supports:

  1. Regexp patterns
  2. AND/OR conditions
  3. References

Installation

go get 'github.com/webtor-io/stoplist'

Sample usage

package main

import (
	"log"
	"github.com/webtor-io/stoplist"
)

var rules = `
main:
- abra
- cadabra
`

func main() error {
    r, err := stoplist.NewRuleFromYaml([]byte(rules))
    if err != nil {
        return err
    }
    res := r.Check("abra cadabra")
    log.Println(res)
    return nil
}

Rules

  1. YAML must have main key - it is starting point
  2. Every key must have an array of rules and all these rules will be used with OR condition, like:
main:
- rule1
- rule2
- ...
  1. All keys can be referenced with curly brackets, like:
rule:
- something
main:
- {rule}
  1. Regular expression must be enclosed with slashes, like:
main:
- /\d+/
  1. OR condition is represented with pipe |, like:
main:
- aaa|bbb|ccc
  1. AND condition is represented with plus +, like:
main:
- aaa+bbb+ccc

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author