args

package
v0.0.0-...-f1bdcb5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConsulArgsRequire

type AppConsulArgsRequire struct {
	Key     map[string]*RequireContent              `json:"key"`
	Service map[string]*AppConsulArgsRequireService `json:"service"`
}

func (*AppConsulArgsRequire) Match

func (a *AppConsulArgsRequire) Match(client *api.Client) (err error)

func (*AppConsulArgsRequire) Validate

func (a *AppConsulArgsRequire) Validate() (err error)

type AppConsulArgsRequireService

type AppConsulArgsRequireService struct {
	Tags    []string `json:"tags"`
	Exist   *Bool    `json:"exist"`
	Healthy *Bool    `json:"healthy"`
}

func (*AppConsulArgsRequireService) Match

func (a *AppConsulArgsRequireService) Match(out []*api.ServiceEntry) (err error)

func (*AppConsulArgsRequireService) Validate

func (a *AppConsulArgsRequireService) Validate() (err error)

type AppRedisArgsRequire

type AppRedisArgsRequire struct {
	Value *RequireValue             `json:"value"`
	Array *AppRedisArgsRequireArray `json:"array"`
	Map   *AppRedisArgsRequireMap   `json:"map"`
}

func (*AppRedisArgsRequire) Match

func (a *AppRedisArgsRequire) Match(value interface{}) (err error)

func (*AppRedisArgsRequire) Validate

func (a *AppRedisArgsRequire) Validate() (err error)

type AppRedisArgsRequireArray

type AppRedisArgsRequireArray struct {
	Count RequireNumeric                 `json:"count"`
	All   *RequireValue                  `json:"all"`
	Value AppRedisArgsRequireArrayValues `json:"value"`
}

func (*AppRedisArgsRequireArray) Match

func (a *AppRedisArgsRequireArray) Match(value interface{}) error

func (*AppRedisArgsRequireArray) Validate

func (a *AppRedisArgsRequireArray) Validate() (err error)

type AppRedisArgsRequireArrayValue

type AppRedisArgsRequireArrayValue struct {
	Index *Uint `json:"index"`
	RequireValue
}

func (*AppRedisArgsRequireArrayValue) Match

func (a *AppRedisArgsRequireArrayValue) Match(value []interface{}) (err error)

func (*AppRedisArgsRequireArrayValue) Validate

func (a *AppRedisArgsRequireArrayValue) Validate() (err error)

type AppRedisArgsRequireArrayValues

type AppRedisArgsRequireArrayValues []*AppRedisArgsRequireArrayValue

func (AppRedisArgsRequireArrayValues) Match

func (a AppRedisArgsRequireArrayValues) Match(values []interface{}) (err error)

func (AppRedisArgsRequireArrayValues) Validate

func (a AppRedisArgsRequireArrayValues) Validate() (err error)

type AppRedisArgsRequireMap

type AppRedisArgsRequireMap struct {
	Count RequireNumeric               `json:"count"`
	All   *RequireValue                `json:"all"`
	Value AppRedisArgsRequireMapValues `json:"value"`
}

func (*AppRedisArgsRequireMap) Match

func (a *AppRedisArgsRequireMap) Match(value interface{}) error

func (*AppRedisArgsRequireMap) Validate

func (a *AppRedisArgsRequireMap) Validate() (err error)

type AppRedisArgsRequireMapValue

type AppRedisArgsRequireMapValue struct {
	Key   *String `json:"key"`
	Exist *Bool   `json:"exist"`
	RequireValue
}

func (*AppRedisArgsRequireMapValue) Match

func (a *AppRedisArgsRequireMapValue) Match(values map[string]interface{}) (err error)

func (*AppRedisArgsRequireMapValue) Validate

func (a *AppRedisArgsRequireMapValue) Validate() (err error)

type AppRedisArgsRequireMapValues

type AppRedisArgsRequireMapValues []*AppRedisArgsRequireMapValue

func (AppRedisArgsRequireMapValues) Match

func (a AppRedisArgsRequireMapValues) Match(values map[string]interface{}) (err error)

func (AppRedisArgsRequireMapValues) Validate

func (a AppRedisArgsRequireMapValues) Validate() (err error)

type Bool

type Bool bool

func (*Bool) Match

func (a *Bool) Match(value bool, True, False string) error

func (*Bool) MatchInterface

func (a *Bool) MatchInterface(value interface{}, True, False string) error

func (*Bool) Validate

func (a *Bool) Validate() error

type Cell

type Cell struct {
	Row
	Column
}

func (*Cell) Match

func (a *Cell) Match(table Table) (err error)

func (*Cell) Validate

func (a *Cell) Validate() (err error)

type CmdArgsRequire

type CmdArgsRequire struct {
	ExitCode *RequireNumeric `json:"exit_code"`
	Output   *RequireContent `json:"output"`
	Stderr   *RequireContent `json:"stderr"`
}

func (*CmdArgsRequire) Match

func (a *CmdArgsRequire) Match(exitCode int, output []byte, stderr []byte) (err error)

func (*CmdArgsRequire) Validate

func (a *CmdArgsRequire) Validate() (err error)

type Column

type Column struct {
	Column Uint `json:"column"`
}

func (*Column) Match

func (a *Column) Match(table Table) (err error)

func (*Column) Validate

func (a *Column) Validate() (err error)

type DialArgsRequire

type DialArgsRequire struct {
	Content *RequireContent `json:"content"`
}

func (*DialArgsRequire) Match

func (a *DialArgsRequire) Match(content []byte) (err error)

func (*DialArgsRequire) Validate

func (a *DialArgsRequire) Validate() (err error)

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

func (Duration) Validate

func (d Duration) Validate() error

type HttArgsRequire

type HttArgsRequire struct {
	Status  *HttpArgsRequireStatus `json:"status"`
	Content *RequireContent        `json:"content"`
	Header  *HttpArgsRequireHeader `json:"header"`
}

func (*HttArgsRequire) Match

func (a *HttArgsRequire) Match(response *http.Response) (err error)

func (*HttArgsRequire) Validate

func (a *HttArgsRequire) Validate() (err error)

type HttpArgsBasicAuth

type HttpArgsBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type HttpArgsForm

type HttpArgsForm struct {
	Values map[string]string `json:"values"`
	Files  map[string]string `json:"files"`
}

func (*HttpArgsForm) SubmitForm

func (a *HttpArgsForm) SubmitForm(b *bytes.Buffer) (contentType string, err error)

func (*HttpArgsForm) Validate

func (a *HttpArgsForm) Validate() (err error)

type HttpArgsRequireContentType

type HttpArgsRequireContentType string
const (
	HttpArgsRequireContentTypeJSON HttpArgsRequireContentType = "JSON"
	HttpArgsRequireContentTypeXML  HttpArgsRequireContentType = "XML"
	HttpArgsRequireContentTypeHTML HttpArgsRequireContentType = "HTML"
	HttpArgsRequireContentTypeYAML HttpArgsRequireContentType = "YAML"
)

func (HttpArgsRequireContentType) Is

func (HttpArgsRequireContentType) Match

func (v HttpArgsRequireContentType) Match(content []byte) error

func (HttpArgsRequireContentType) Validate

func (v HttpArgsRequireContentType) Validate() error

type HttpArgsRequireHeader

type HttpArgsRequireHeader struct {
	Exists    []string                        `json:"exists"`
	NotExists []string                        `json:"not_exists"`
	Regexp    map[string]RequireFieldMatch    `json:"match"`
	NotRegexp map[string]RequireFieldMatchNot `json:"not_match"`
	Eq        map[string][]string             `json:"eq"`
}

func (*HttpArgsRequireHeader) Match

func (a *HttpArgsRequireHeader) Match(header http.Header) (err error)

func (*HttpArgsRequireHeader) Validate

func (a *HttpArgsRequireHeader) Validate() (err error)

type HttpArgsRequireStatus

type HttpArgsRequireStatus struct {
	RequireNumeric
}

func (*HttpArgsRequireStatus) Match

func (a *HttpArgsRequireStatus) Match(status int) error

func (*HttpArgsRequireStatus) Validate

func (a *HttpArgsRequireStatus) Validate() error

type JSONSchema

type JSONSchema string

func (*JSONSchema) Match

func (a *JSONSchema) Match(value []byte) error

func (*JSONSchema) MatchString

func (a *JSONSchema) MatchString(value string) error

func (*JSONSchema) Validate

func (a *JSONSchema) Validate() error

type ReachText

type ReachText struct {
	Text *string `json:"text"`
	File *string `json:"file"`
	RN   bool    `json:"rn"`
}

func (*ReachText) Validate

func (a *ReachText) Validate() (err error)

func (*ReachText) Value

func (a *ReachText) Value() (reader io.ReadCloser, err error)

type RepeatArgsRequire

type RepeatArgsRequire struct {
	Success Uint `json:"success"`
	Warning Uint `json:"warning"`
}

func (*RepeatArgsRequire) Validate

func (a *RepeatArgsRequire) Validate() (err error)

type RequireContent

type RequireContent struct {
	Type   HttpArgsRequireContentType `json:"type"`
	Length *RequireNumeric            `json:"length"`
	JSON   []RequireJSON              `json:"json"`
	XML    []RequireXPath             `json:"xml"`
	HTML   []RequireXPath             `json:"html"`
	Text   []RequireMatch             `json:"text"`
}

func (*RequireContent) Match

func (a *RequireContent) Match(name string, content []byte) (err error)

func (*RequireContent) Validate

func (a *RequireContent) Validate() (err error)

type RequireFieldMatch

type RequireFieldMatch []string

func (RequireFieldMatch) Match

func (match RequireFieldMatch) Match(name string, input []byte) error

func (RequireFieldMatch) MatchStrings

func (match RequireFieldMatch) MatchStrings(name string, input []string) error

func (RequireFieldMatch) Validate

func (match RequireFieldMatch) Validate() error

type RequireFieldMatchNot

type RequireFieldMatchNot []string

func (RequireFieldMatchNot) Match

func (match RequireFieldMatchNot) Match(name string, input []byte) error

func (RequireFieldMatchNot) MatchStrings

func (match RequireFieldMatchNot) MatchStrings(name string, input []string) error

func (RequireFieldMatchNot) Validate

func (match RequireFieldMatchNot) Validate() error

type RequireJSON

type RequireJSON struct {
	JSONPath string `json:"jsonpath"`
	RequireXPath
	RequireJSONSchema
}

func (*RequireJSON) Match

func (a *RequireJSON) Match(name string, content []byte) (err error)

func (*RequireJSON) Validate

func (a *RequireJSON) Validate() (err error)

type RequireJSONPath

type RequireJSONPath struct {
	JSONPath string `json:"jsonpath"`
	RequireMatch
	RequireJSONSchema
}

func (*RequireJSONPath) Match

func (a *RequireJSONPath) Match(name string, content []byte) error

func (*RequireJSONPath) Validate

func (a *RequireJSONPath) Validate() (err error)

type RequireJSONSchema

type RequireJSONSchema struct {
	JSONSchema *JSONSchema `json:"jsonschema"`
}

func (*RequireJSONSchema) Match

func (a *RequireJSONSchema) Match(content []byte) (err error)

func (*RequireJSONSchema) Validate

func (a *RequireJSONSchema) Validate() error

type RequireMatch

type RequireMatch struct {
	Regexp    RequireFieldMatch    `json:"match"`
	NotRegexp RequireFieldMatchNot `json:"not_match"`
}

func (*RequireMatch) Match

func (a *RequireMatch) Match(name string, input []byte) (err error)

func (*RequireMatch) MatchStrings

func (a *RequireMatch) MatchStrings(name string, input []string) (err error)

func (*RequireMatch) Validate

func (a *RequireMatch) Validate() (err error)

type RequireNumeric

type RequireNumeric struct {
	In    []float64 `json:"in"`
	NotIn []float64 `json:"not_in"`
	Eq    *float64  `json:"eq"`
	Le    *float64  `json:"le"`
	Leq   *float64  `json:"leq"`
	Ge    *float64  `json:"ge"`
	Geq   *float64  `json:"geq"`
	Not   *float64  `json:"not"`
}

func (*RequireNumeric) Match

func (a *RequireNumeric) Match(name string, numeric float64) error

func (*RequireNumeric) MatchInt

func (a *RequireNumeric) MatchInt(name string, numeric int) error

func (*RequireNumeric) MatchString

func (a *RequireNumeric) MatchString(name string, str string) error

func (*RequireNumeric) Validate

func (a *RequireNumeric) Validate() (err error)

type RequireValue

type RequireValue struct {
	IsNull  *Bool           `json:"is_null"`
	Numeric *RequireNumeric `json:"numeric"`
	Content *RequireContent `json:"content"`
	Bool    *Bool           `json:"bool"`
}

func (*RequireValue) Match

func (a *RequireValue) Match(value interface{}) (err error)

func (*RequireValue) Validate

func (a *RequireValue) Validate() (err error)

type RequireXPath

type RequireXPath struct {
	XPath string `json:"xpath"`
	RequireMatch
}

func (*RequireXPath) Match

func (a *RequireXPath) Match(name string, _type HttpArgsRequireContentType, content []byte) (err error)

func (*RequireXPath) Validate

func (a *RequireXPath) Validate() error

type Row

type Row struct {
	Row Uint `json:"row"`
}

func (*Row) Match

func (a *Row) Match(table Table) (err error)

func (*Row) Validate

func (a *Row) Validate() (err error)

type Slice

type Slice []interface{}

func (Slice) Match

func (a Slice) Match(slice Slice, null string) (err error)

func (Slice) Validate

func (a Slice) Validate() (err error)

type SqlArgsRequire

type SqlArgsRequire struct {
	Count  RequireNumeric        `json:"count"`
	Rows   SqlArgsRequireTable   `json:"rows"`
	Row    SqlArgsRequireRows    `json:"row"`
	Column SqlArgsRequireColumns `json:"column"`
	Cell   SqlArgsRequireCells   `json:"cell"`
}

func (*SqlArgsRequire) Match

func (a *SqlArgsRequire) Match(rows Table) (err error)

func (*SqlArgsRequire) Validate

func (a *SqlArgsRequire) Validate() (err error)

type SqlArgsRequireCell

type SqlArgsRequireCell struct {
	Cell
	RequireValue
}

func (*SqlArgsRequireCell) Match

func (a *SqlArgsRequireCell) Match(rows Table) (err error)

func (*SqlArgsRequireCell) Validate

func (a *SqlArgsRequireCell) Validate() (err error)

type SqlArgsRequireCells

type SqlArgsRequireCells []SqlArgsRequireCell

func (SqlArgsRequireCells) Match

func (a SqlArgsRequireCells) Match(rows Table) (err error)

func (SqlArgsRequireCells) Validate

func (a SqlArgsRequireCells) Validate() (err error)

type SqlArgsRequireColumn

type SqlArgsRequireColumn struct {
	Column
	RequireValue
	Value Slice `json:"value"`
}

func (*SqlArgsRequireColumn) Match

func (a *SqlArgsRequireColumn) Match(table Table) (err error)

func (*SqlArgsRequireColumn) Validate

func (a *SqlArgsRequireColumn) Validate() (err error)

type SqlArgsRequireColumns

type SqlArgsRequireColumns []SqlArgsRequireColumn

func (SqlArgsRequireColumns) Match

func (a SqlArgsRequireColumns) Match(table Table) (err error)

func (SqlArgsRequireColumns) Validate

func (a SqlArgsRequireColumns) Validate() (err error)

type SqlArgsRequireRow

type SqlArgsRequireRow struct {
	Row
	RequireValue
	Value Slice `json:"value"`
}

func (*SqlArgsRequireRow) Match

func (a *SqlArgsRequireRow) Match(table Table) (err error)

func (*SqlArgsRequireRow) Validate

func (a *SqlArgsRequireRow) Validate() (err error)

type SqlArgsRequireRows

type SqlArgsRequireRows []SqlArgsRequireRow

func (SqlArgsRequireRows) Match

func (a SqlArgsRequireRows) Match(table Table) (err error)

func (SqlArgsRequireRows) Validate

func (a SqlArgsRequireRows) Validate() (err error)

type SqlArgsRequireTable

type SqlArgsRequireTable struct {
	Value Table `json:"value"`
	RequireValue
}

func (*SqlArgsRequireTable) Match

func (a *SqlArgsRequireTable) Match(table Table) (err error)

func (*SqlArgsRequireTable) Validate

func (a *SqlArgsRequireTable) Validate() (err error)

type String

type String string

func (String) Validate

func (a String) Validate() (err error)

func (String) Value

func (a String) Value() string

type Table

type Table [][]interface{}

func (Table) Column

func (a Table) Column(index int) Slice

func (Table) Match

func (a Table) Match(table [][]interface{}, null string) (err error)

func (Table) Row

func (a Table) Row(index int) Slice

func (Table) Validate

func (a Table) Validate() (err error)

type Uint

type Uint int

func (Uint) Validate

func (a Uint) Validate() (err error)

type Validatable

type Validatable interface {
	Validate() (err error)
}

Jump to

Keyboard shortcuts

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