Documentation ¶
Overview ¶
Package regex provides the service layer for building apps using regex functionality.
Index ¶
- Constants
- Variables
- func Delete(context interface{}, db *db.DB, name string) error
- func GetNames(context interface{}, db *db.DB) ([]string, error)
- func Upsert(context interface{}, db *db.DB, rgx Regex) error
- type Regex
- func GetAll(context interface{}, db *db.DB, tags []string) ([]Regex, error)
- func GetByName(context interface{}, db *db.DB, name string) (Regex, error)
- func GetByNames(context interface{}, db *db.DB, names []string) ([]Regex, error)
- func GetLastHistoryByName(context interface{}, db *db.DB, name string) (Regex, error)
Constants ¶
View Source
const ( Collection = "query_regexs" CollectionHistory = "query_regexs_history" )
Contains the name of Mongo collections.
Variables ¶
View Source
var (
ErrNotFound = errors.New("Regex Not found")
)
Set of error variables.
Functions ¶
Types ¶
type Regex ¶
type Regex struct { Name string `bson:"name" json:"name" validate:"required,min=3"` Expr string `bson:"expr" json:"expr" validate:"required,min=3"` Compile *regexp.Regexp }
Regex contains a single regular expresion bound to a name.
func GetByNames ¶
GetByNames retrieves the documents for the specified names.
func GetLastHistoryByName ¶
GetLastHistoryByName gets the last written Regex within the history.
Click to show internal directories.
Click to hide internal directories.