popeye: github.com/derailed/popeye/internal/issues Index | Files

package issues

import "github.com/derailed/popeye/internal/issues"


Package Files

codes.go collector.go issue.go issues.go


const Root = "__root__"

Root denotes a root issue group.


var Blank = Issue{}

Blank issue

func LevelToStr Uses

func LevelToStr(l config.Level) string

LevelToStr returns a severity level as a string.

type Codes Uses

type Codes struct {
    Glossary config.Glossary `yaml:"codes"`

Codes represents a collection of sanitizer codes.

func LoadCodes Uses

func LoadCodes() (*Codes, error)

LoadCodes retrieves sanitifizers codes from yaml file.

func (*Codes) Refine Uses

func (c *Codes) Refine(gloss config.Glossary)

Refine overrides code severity based on user input.

type Collector Uses

type Collector struct {
    // contains filtered or unexported fields

Collector represents a sanitizer issue container.

func NewCollector Uses

func NewCollector(codes *Codes, cfg *config.Config) *Collector

NewCollector returns a new issue collector.

func (*Collector) AddCode Uses

func (c *Collector) AddCode(ctx context.Context, code config.ID, args ...interface{})

AddCode add an error code.

func (*Collector) AddErr Uses

func (c *Collector) AddErr(ctx context.Context, errs ...error)

AddErr adds a collection of errors.

func (*Collector) AddSubCode Uses

func (c *Collector) AddSubCode(ctx context.Context, code config.ID, args ...interface{})

AddSubCode add a sub error code.

func (*Collector) ClearOutcome Uses

func (c *Collector) ClearOutcome(fqn string)

ClearOutcome delete all fqn related issues.

func (*Collector) InitOutcome Uses

func (c *Collector) InitOutcome(fqn string)

InitOutcome creates a places holder for potential issues.

func (*Collector) MaxSeverity Uses

func (c *Collector) MaxSeverity(fqn string) config.Level

MaxSeverity return the highest severity level foe the given section.

func (*Collector) NoConcerns Uses

func (c *Collector) NoConcerns(fqn string) bool

NoConcerns returns true is scan is successful.

func (*Collector) Outcome Uses

func (c *Collector) Outcome() Outcome

Outcome returns scan outcome.

type Issue Uses

type Issue struct {
    Group   string       `yaml:"group" json:"group"`
    GVR     string       `yaml:"gvr" json:"gvr"`
    Level   config.Level `yaml:"level" json:"level"`
    Message string       `yaml:"message" json:"message"`

Issue tracks a sanitizer issui.

func New Uses

func New(gvr client.GVR, group string, level config.Level, description string) Issue

New returns a new lint issue.

func Newf Uses

func Newf(gvr client.GVR, group string, level config.Level, format string, args ...interface{}) Issue

Newf returns a new lint issue using a formatter.

func (Issue) Blank Uses

func (i Issue) Blank() bool

Blank checks if an issue is blank.

func (Issue) IsSubIssue Uses

func (i Issue) IsSubIssue() bool

IsSubIssue checks if error is a sub error.

type Issues Uses

type Issues []Issue

Issues represents a collection of issues.

func (Issues) Group Uses

func (i Issues) Group() map[string]Issues

Group collect issues as groups.

func (Issues) MaxSeverity Uses

func (i Issues) MaxSeverity() config.Level

MaxSeverity gather the max severity in a collection of issues.

func (Issues) Sort Uses

func (i Issues) Sort(l config.Level) Issues

Sort sorts issues.

type Outcome Uses

type Outcome map[string]Issues

Outcome represents outcomes resulting from sanitization pass.

func (Outcome) Filter Uses

func (o Outcome) Filter(level config.Level) Outcome

Filter filters outcomes based on sanitizer level.

func (Outcome) For Uses

func (o Outcome) For(section, group string) Issues

For returns issues for a given section/group.

func (Outcome) MaxGroupSeverity Uses

func (o Outcome) MaxGroupSeverity(section, group string) config.Level

MaxGroupSeverity scans the issues and reports the highest severity.

func (Outcome) MaxSeverity Uses

func (o Outcome) MaxSeverity(section string) config.Level

MaxSeverity scans the issues and reports the highest severity.

Package issues imports 8 packages (graph) and is imported by 4 packages. Updated 2020-08-05. Refresh now. Tools for package owners.