Documentation
¶
Index ¶
- type Validator
- func (v *Validator) AddForbiddenImport(importPath string)
- func (v *Validator) AddForbiddenKeyword(keyword string)
- func (v *Validator) GetForbiddenImports() []string
- func (v *Validator) GetForbiddenKeywords() []string
- func (v *Validator) SetMaxSourceSize(size int)
- func (v *Validator) Validate(sourceCode string) error
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 ¶
AddForbiddenImport adds an import to the forbidden list
func (*Validator) AddForbiddenKeyword ¶
AddForbiddenKeyword adds a keyword to the forbidden list
func (*Validator) GetForbiddenImports ¶
GetForbiddenImports returns the list of forbidden imports
func (*Validator) GetForbiddenKeywords ¶
GetForbiddenKeywords returns the list of forbidden keywords
func (*Validator) SetMaxSourceSize ¶
SetMaxSourceSize sets the maximum allowed source code size
Click to show internal directories.
Click to hide internal directories.