Documentation ¶
Index ¶
- Constants
- func RulesConfigExample1() map[string]RuleConfig
- func ValidateRules(rules map[string]Rule) error
- type EmptyRule
- func (rule EmptyRule) Name() string
- func (rule EmptyRule) ProcessOperation(spec *oas3.Swagger, op *oas3.Operation, opPointer, path, method string) []lintutil.PolicyViolation
- func (rule EmptyRule) ProcessSpec(spec *oas3.Swagger, pointerBase string) []lintutil.PolicyViolation
- func (rule EmptyRule) Scope() string
- func (rule EmptyRule) Severity() string
- type Policy
- type PolicyConfig
- type Rule
- type RuleCollection
- type RuleCollectionStandard
- type RuleCollections
- type RuleConfig
- type RulesMap
- type StandardRuleNames
Constants ¶
View Source
const ( RuleTypeAll = "all" RuleTypeStandard = "standard" RuleTypeXDefined = "xdefined" RuleTypeXUndefined = "xundefined" )
Variables ¶
This section is empty.
Functions ¶
func RulesConfigExample1 ¶ added in v1.7.0
func RulesConfigExample1() map[string]RuleConfig
func ValidateRules ¶
Types ¶
type EmptyRule ¶ added in v1.7.0
type EmptyRule struct{}
func (EmptyRule) ProcessOperation ¶ added in v1.7.0
func (EmptyRule) ProcessSpec ¶ added in v1.7.0
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
func (*Policy) ValidateSpec ¶
type PolicyConfig ¶
type PolicyConfig struct { Name string `json:"name"` Version string `json:"version"` LastUpdated time.Time `json:"lastUpdated,omitempty"` IncludeStandardRules bool `json:"includeStandardRules"` Rules map[string]RuleConfig `json:"rules,omitempty"` NonStandardRules []string `json:"nonStandardRules,omitempty"` // contains filtered or unexported fields }
func NewPolicyConfigFile ¶
func NewPolicyConfigFile(filename string) (PolicyConfig, error)
func (*PolicyConfig) AddRuleCollection ¶ added in v1.7.3
func (polCfg *PolicyConfig) AddRuleCollection(collection RuleCollection)
func (*PolicyConfig) Policy ¶ added in v1.7.3
func (cfg *PolicyConfig) Policy() (Policy, error)
func (*PolicyConfig) RuleNames ¶ added in v1.7.1
func (polCfg *PolicyConfig) RuleNames() map[string][]string
type Rule ¶
type Rule interface { Name() string Scope() string Severity() string ProcessSpec(spec *oas3.Swagger, pointerBase string) []lintutil.PolicyViolation ProcessOperation(spec *oas3.Swagger, op *oas3.Operation, opPointer, path, method string) []lintutil.PolicyViolation }
func NewStandardRule ¶ added in v1.7.0
type RuleCollection ¶ added in v1.7.3
type RuleCollectionStandard ¶ added in v1.7.3
type RuleCollectionStandard struct {
// contains filtered or unexported fields
}
func NewRuleCollectionStandard ¶ added in v1.7.3
func NewRuleCollectionStandard() RuleCollectionStandard
func (RuleCollectionStandard) Name ¶ added in v1.7.3
func (std RuleCollectionStandard) Name() string
func (RuleCollectionStandard) Rule ¶ added in v1.7.3
func (std RuleCollectionStandard) Rule(name, severity string) (Rule, error)
func (RuleCollectionStandard) RuleExists ¶ added in v1.7.3
func (std RuleCollectionStandard) RuleExists(ruleName string) bool
func (RuleCollectionStandard) RuleNames ¶ added in v1.7.3
func (std RuleCollectionStandard) RuleNames() []string
type RuleCollections ¶ added in v1.7.3
type RuleCollections []RuleCollection
type RuleConfig ¶
type RuleConfig struct {
Severity string `json:"severity"`
}
type StandardRuleNames ¶ added in v1.7.0
type StandardRuleNames struct {
// contains filtered or unexported fields
}
func NewStandardRuleNames ¶ added in v1.7.1
func NewStandardRuleNames() *StandardRuleNames
func (*StandardRuleNames) Exists ¶ added in v1.7.1
func (srn *StandardRuleNames) Exists(ruleName string) bool
func (*StandardRuleNames) Slice ¶ added in v1.7.1
func (srn *StandardRuleNames) Slice() []string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.