caasiu

package module
v0.0.0-...-f010d7a Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 9 Imported by: 0

README

caasiu

caasiu is a simple http request validator

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyRegistered = errors.New("rule already registered")
)

Functions

func RegisterRule

func RegisterRule(ruleName string, ruleFunc func(string, string, interface{}) (bool, string)) error

Types

type Caasiu

type Caasiu struct {
	// contains filtered or unexported fields
}

func New

func New(r *http.Request) (*Caasiu, error)

func (*Caasiu) JsonBodyData

func (c *Caasiu) JsonBodyData() *simplejson.Json

func (*Caasiu) QueryStringData

func (c *Caasiu) QueryStringData() map[string]string

func (*Caasiu) Valid

func (c *Caasiu) Valid(rules Rules) (bool, []string)

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

func NewJSON

func NewJSON(json []byte) *JSON

func (*JSON) Data

func (j *JSON) Data() *simplejson.Json

func (*JSON) Raw

func (j *JSON) Raw() []byte

func (*JSON) Valid

func (j *JSON) Valid(rule map[string][]string) []string

type QueryString

type QueryString struct {
	// contains filtered or unexported fields
}

func NewQueryString

func NewQueryString(value url.Values) *QueryString

func (*QueryString) Data

func (q *QueryString) Data() map[string]string

func (*QueryString) Raw

func (q *QueryString) Raw() url.Values

func (*QueryString) Valid

func (q *QueryString) Valid(rule map[string][]string) []string

type Rule

type Rule = map[string][]string

type Rules

type Rules struct {
	QueryString Rule
	Body        Rule
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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