Documentation ¶
Index ¶
- func ParseRequest(req string, entry *LogEntry)
- type ConfigDetector
- type LogEntry
- func (e *LogEntry) Description() string
- func (rec *LogEntry) DetechError(cfg ConfigDetector, api *openapi3.T, baseUrl string)
- func (l *LogEntry) DetectDeepErrorByDef(path, mName string, def *openapi3.Operation, parsInPath map[string]string)
- func (l *LogEntry) DetectErrorByDef(def *openapi3.Operation, parsInPath map[string]string)
- func (e *LogEntry) FillByRecord(recs []string)
- func (e *LogEntry) GetErrorTypeByParameterErrors() etype.EntryError
- func (l *LogEntry) SeperatePath()
- func (e *LogEntry) String() string
- func (e *LogEntry) WriteTo(w io.Writer, newLine string) error
- type LogEntryResponse
- type ParameterError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRequest ¶
Types ¶
type ConfigDetector ¶ added in v0.9.0
type LogEntry ¶
type LogEntry struct { Url string `json:"u"` Method string `json:"m,omitempty"` Protocol string `json:"p,omitempty"` Client string `json:"c,omitempty"` //client ip StatusCode int `json:"s,omitempty"` Legal bool `json:"l,omitempty"` Query url.Values `json:"q,omitempty"` //OpenAPI参数错误 ParameterErrors map[int]*ParameterError `json:"pe,omitempty"` // ErrorType etype.EntryError `json:"e,omitempty"` Created time.Time `json:"t"` Count int64 //used for stat in rule Notified bool `json:"n,omitempty"` Version int `json:"v,omitempty"` }
func ParseString ¶
func (*LogEntry) Description ¶
func (*LogEntry) DetechError ¶ added in v0.9.0
func (rec *LogEntry) DetechError(cfg ConfigDetector, api *openapi3.T, baseUrl string)
func (*LogEntry) DetectDeepErrorByDef ¶ added in v0.9.0
func (l *LogEntry) DetectDeepErrorByDef(path, mName string, def *openapi3.Operation, parsInPath map[string]string)
进行深度探测,调用featuredb包进行深入的聚类分析
func (*LogEntry) DetectErrorByDef ¶
详细探测错误的类型,根据OpenAPI定义中的参数的具体设置范围,探测请求的范围
func (*LogEntry) FillByRecord ¶
func (*LogEntry) GetErrorTypeByParameterErrors ¶ added in v0.9.0
func (e *LogEntry) GetErrorTypeByParameterErrors() etype.EntryError
func (*LogEntry) SeperatePath ¶
func (l *LogEntry) SeperatePath()
type LogEntryResponse ¶
type ParameterError ¶
type ParameterError struct { Type bool `json:"type,omitempty" yaml:"type,omitempty"` Format bool `json:"format,omitempty" yaml:"format,omitempty"` Enum bool `json:"enum,omitempty" yaml:"enum,omitempty"` Name string In string Required bool `json:"required,omitempty" yaml:"required,omitempty"` // Array-related, here for struct compactness UniqueItems bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"` // Number-related, here for struct compactness ExclusiveMin bool `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"` ExclusiveMax bool `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"` // Properties Nullable bool `json:"nullable,omitempty" yaml:"nullable,omitempty"` AllowEmptyValue bool `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"` Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` // Number Min bool `json:"minimum,omitempty" yaml:"minimum,omitempty"` Max bool `json:"maximum,omitempty" yaml:"maximum,omitempty"` MultipleOf bool `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"` // String MinLength bool `json:"minLength,omitempty" yaml:"minLength,omitempty"` MaxLength bool `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` Pattern bool `json:"pattern,omitempty" yaml:"pattern,omitempty"` // Array MinItems bool `json:"minItems,omitempty" yaml:"minItems,omitempty"` MaxItems bool `json:"maxItems,omitempty" yaml:"maxItems,omitempty"` }
func (*ParameterError) HasError ¶
func (e *ParameterError) HasError() bool
Click to show internal directories.
Click to hide internal directories.