render

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(kind string, w io.Writer) (malcontent.Renderer, error)

New returns a new Renderer.

func ShortRisk

func ShortRisk(s string) string

func Statistics

func Statistics(r *malcontent.Report) error

Types

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

func NewJSON

func NewJSON(w io.Writer) JSON

func (JSON) File

func (JSON) Full

func (r JSON) Full(_ context.Context, rep *malcontent.Report) error

func (JSON) Scanning added in v1.2.0

func (r JSON) Scanning(_ context.Context, _ string)

type KeyedBehavior

type KeyedBehavior struct {
	Key      string
	Behavior *malcontent.Behavior
}

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

func NewMarkdown

func NewMarkdown(w io.Writer) Markdown

func (Markdown) File

func (Markdown) Full

func (r Markdown) Full(ctx context.Context, rep *malcontent.Report) error

func (Markdown) Scanning added in v1.2.0

func (r Markdown) Scanning(_ context.Context, _ string)

type Match added in v1.2.0

type Match struct {
	Description string
	Risk        int
	Rule        string
	Strings     []string
}

type Report added in v1.5.0

type Report struct {
	Diff   *malcontent.DiffReport            `json:",omitempty" yaml:",omitempty"`
	Files  map[string]*malcontent.FileReport `json:",omitempty" yaml:",omitempty"`
	Filter string                            `json:",omitempty" yaml:",omitempty"`
}

Report stores a JSON- or YAML-friendly representation of File Reports.

type Simple

type Simple struct {
	// contains filtered or unexported fields
}

func NewSimple

func NewSimple(w io.Writer) Simple

func (Simple) File

func (Simple) Full

func (r Simple) Full(_ context.Context, rep *malcontent.Report) error

func (Simple) Scanning added in v1.2.0

func (r Simple) Scanning(_ context.Context, _ string)

type StringMatches added in v1.2.0

type StringMatches struct {
	// contains filtered or unexported fields
}

func NewStringMatches added in v1.2.0

func NewStringMatches(w io.Writer) StringMatches

func (StringMatches) File added in v1.2.0

func (StringMatches) Full added in v1.2.0

func (StringMatches) Scanning added in v1.2.0

func (r StringMatches) Scanning(_ context.Context, path string)

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

func NewTerminal

func NewTerminal(w io.Writer) Terminal

func (Terminal) File

func (Terminal) Full

func (r Terminal) Full(ctx context.Context, rep *malcontent.Report) error

func (Terminal) Scanning added in v1.2.0

func (r Terminal) Scanning(_ context.Context, path string)

type TerminalBrief

type TerminalBrief struct {
	// contains filtered or unexported fields
}

func NewTerminalBrief

func NewTerminalBrief(w io.Writer) TerminalBrief

func (TerminalBrief) File

func (TerminalBrief) Full

func (TerminalBrief) Scanning added in v1.2.0

func (r TerminalBrief) Scanning(_ context.Context, path string)

type YAML

type YAML struct {
	// contains filtered or unexported fields
}

func NewYAML

func NewYAML(w io.Writer) YAML

func (YAML) File

func (YAML) Full

func (r YAML) Full(_ context.Context, rep *malcontent.Report) error

func (YAML) Scanning added in v1.2.0

func (r YAML) Scanning(_ context.Context, _ string)

Jump to

Keyboard shortcuts

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