interfaces

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer(opts ...Option) *Container

func (*Container) Check

func (r *Container) Check(ctx *core.Context) []core.Violation

func (*Container) Spec

func (r *Container) Spec() core.RuleSpec

type CrossDomainAnonymous

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

func NewCrossDomainAnonymous

func NewCrossDomainAnonymous(opts ...Option) *CrossDomainAnonymous

func (*CrossDomainAnonymous) Check

func (r *CrossDomainAnonymous) Check(ctx *core.Context) []core.Violation

func (*CrossDomainAnonymous) Spec

type Option

type Option func(*ruleConfig)

func WithMaxMethods

func WithMaxMethods(n int) Option

WithMaxMethods sets the per-interface method count cap. It applies only to interfaces.NewTooManyMethods — passing it to other interfaces.New*() rules (NewPattern, NewContainer, NewCrossDomainAnonymous) is silently ignored to keep the option API uniform across the package.

Values <= 0 are treated as "use the default" (currently 10).

func WithSeverity

func WithSeverity(severity core.Severity) Option

type Pattern

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

func NewPattern

func NewPattern(opts ...Option) *Pattern

func (*Pattern) Check

func (r *Pattern) Check(ctx *core.Context) []core.Violation

func (*Pattern) Spec

func (r *Pattern) Spec() core.RuleSpec

type TooManyMethods

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

TooManyMethods flags interfaces whose method count exceeds the configured cap (default 10). Override the cap with interfaces.WithMaxMethods(n).

Scope mirrors interfaces.Pattern: the rule iterates every loaded package, applies the same Architecture-driven exclusion (isExcludedInterfacePatternPkg), and only inspects exported interfaces declared in those packages.

func NewTooManyMethods

func NewTooManyMethods(opts ...Option) *TooManyMethods

func (*TooManyMethods) Check

func (r *TooManyMethods) Check(ctx *core.Context) []core.Violation

func (*TooManyMethods) Spec

func (r *TooManyMethods) Spec() core.RuleSpec

Jump to

Keyboard shortcuts

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