Documentation
¶
Index ¶
- 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 RuleConfig
- type RulesMap
- type StandardRuleNames
Constants ¶
This section is empty.
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"`
Rules map[string]RuleConfig `json:"rules,omitempty"`
NonStandardRules []string `json:"nonStandardRules,omitempty"`
}
func NewPolicyConfigFile ¶
func NewPolicyConfigFile(filename string) (PolicyConfig, error)
func (*PolicyConfig) RuleNames ¶ added in v1.7.1
func (polCfg *PolicyConfig) RuleNames() ([]string, []string, []string)
func (*PolicyConfig) StandardPolicy ¶
func (cfg *PolicyConfig) StandardPolicy() (Policy, error)
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 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
Click to show internal directories.
Click to hide internal directories.