rule

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Excluding

type Excluding []Match

func (Excluding) MarshalJSON

func (e Excluding) MarshalJSON() ([]byte, error)

func (*Excluding) UnmarshalJSON

func (e *Excluding) UnmarshalJSON(data []byte) error

type Match

type Match struct {
	Stdlib   bool        `json:"stdlib,omitzero"`
	Package  StringMatch `json:"package,omitzero"`
	Type     StringMatch `json:"type,omitzero"`
	Function StringMatch `json:"func,omitzero"`
	Global   StringMatch `json:"global,omitzero"`
	Init     bool        `json:"init,omitzero"`
	Foreign  bool        `json:"foreign,omitzero"`
}

func (*Match) MatchFunction

func (r *Match) MatchFunction(f *ssa.Function, stdlib []string) bool

func (*Match) MatchGlobal

func (r *Match) MatchGlobal(g *ssa.Global) bool

func (*Match) MatchPackage

func (r *Match) MatchPackage(p *ssa.Package, stdlib []string, foreign bool) bool

type Rule

type Rule struct {
	Match
	Description  string    `json:"description,omitzero"`
	Trusted      bool      `json:"trusted,omitempty"`
	Expected     []string  `json:"expected,omitempty"`
	Encapsulates []string  `json:"encapsulates,omitempty"`
	Has          []string  `json:"has,omitempty"`
	Excluding    Excluding `json:"excluding,omitempty"`
	// contains filtered or unexported fields
}

func ReadRules

func ReadRules(reader io.Reader, filename string, builtin bool) (result []Rule, err error)

func (*Rule) MatchFunction

func (r *Rule) MatchFunction(f *ssa.Function, stdlib []string) bool

func (*Rule) MatchGlobal

func (r *Rule) MatchGlobal(g *ssa.Global) bool

func (*Rule) MatchPackage

func (r *Rule) MatchPackage(p *ssa.Package, stdlib []string, foreign bool) bool

type RuleError

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

func (RuleError) Error

func (e RuleError) Error() string

func (RuleError) Unwrap

func (e RuleError) Unwrap() error

type StringMatch

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

func ExactString

func ExactString(val string) StringMatch

func (StringMatch) IsZero

func (m StringMatch) IsZero() bool

func (StringMatch) MarshalJSON

func (m StringMatch) MarshalJSON() ([]byte, error)

func (*StringMatch) Match

func (m *StringMatch) Match(val string) bool

func (*StringMatch) MatchNothing

func (m *StringMatch) MatchNothing() bool

func (*StringMatch) UnmarshalJSON

func (m *StringMatch) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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