validator

package
v0.0.0-...-c5c3a70 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

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

Validator validates Go source code for security concerns

func NewValidator

func NewValidator() *Validator

NewValidator creates a new validator with default security settings

func (*Validator) AddForbiddenImport

func (v *Validator) AddForbiddenImport(importPath string)

AddForbiddenImport adds an import to the forbidden list

func (*Validator) AddForbiddenKeyword

func (v *Validator) AddForbiddenKeyword(keyword string)

AddForbiddenKeyword adds a keyword to the forbidden list

func (*Validator) GetForbiddenImports

func (v *Validator) GetForbiddenImports() []string

GetForbiddenImports returns the list of forbidden imports

func (*Validator) GetForbiddenKeywords

func (v *Validator) GetForbiddenKeywords() []string

GetForbiddenKeywords returns the list of forbidden keywords

func (*Validator) SetMaxSourceSize

func (v *Validator) SetMaxSourceSize(size int)

SetMaxSourceSize sets the maximum allowed source code size

func (*Validator) Validate

func (v *Validator) Validate(sourceCode string) error

Validate checks source code for security issues

Jump to

Keyboard shortcuts

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