filemanager: github.com/hacdias/filemanager/rules Index | Files

package rules

import "github.com/hacdias/filemanager/rules"

Index

Package Files

rules.go

type Checker Uses

type Checker interface {
    Check(path string) bool
}

Checker is a Rules checker.

type Regexp Uses

type Regexp struct {
    Raw string `json:"raw"`
    // contains filtered or unexported fields
}

Regexp is a wrapper to the native regexp type where we save the raw expression.

func (*Regexp) MatchString Uses

func (r *Regexp) MatchString(s string) bool

MatchString checks if a string matches the regexp.

type Rule Uses

type Rule struct {
    Regex  bool    `json:"regex"`
    Allow  bool    `json:"allow"`
    Path   string  `json:"path"`
    Regexp *Regexp `json:"regexp"`
}

Rule is a allow/disallow rule.

func (*Rule) Matches Uses

func (r *Rule) Matches(path string) bool

Matches matches a path against a rule.

Package rules imports 2 packages (graph). Updated 2019-07-01. Refresh now. Tools for package owners.