Documentation ¶
Index ¶
- Variables
- func ParseEnv(env string) []string
- type Checker
- type Config
- type ConfigFinder
- type ConfigFinderImpl
- type ConfigReader
- type ConfigReaderImpl
- type ConfigYAML
- type MockConfigFinder
- type MockConfigReader
- type MockReader
- type MockValidator
- type Package
- type Reader
- type ReaderImpl
- type Registry
- type Validator
- type ValidatorImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigFileNotFound = errors.New("policy file isn't found")
Functions ¶
Types ¶
type Config ¶
type Config struct { Path string Allowed bool YAML *ConfigYAML }
type ConfigFinder ¶ added in v2.3.0
type ConfigFinderImpl ¶ added in v2.3.0
type ConfigFinderImpl struct {
// contains filtered or unexported fields
}
func NewConfigFinder ¶ added in v2.3.0
func NewConfigFinder(fs afero.Fs) *ConfigFinderImpl
type ConfigReader ¶
type ConfigReaderImpl ¶
type ConfigReaderImpl struct {
// contains filtered or unexported fields
}
func NewConfigReader ¶
func NewConfigReader(fs afero.Fs) *ConfigReaderImpl
type ConfigYAML ¶
type MockConfigFinder ¶ added in v2.3.0
type MockConfigFinder struct {
// contains filtered or unexported fields
}
type MockConfigReader ¶
type MockReader ¶ added in v2.3.0
func (*MockReader) ReadFromEnv ¶ added in v2.3.0
func (reader *MockReader) ReadFromEnv(policyFilePaths []string) ([]*Config, error)
type MockValidator ¶ added in v2.3.0
type MockValidator struct {
Err error
}
func (*MockValidator) Allow ¶ added in v2.3.0
func (validator *MockValidator) Allow(p string) error
func (*MockValidator) Deny ¶ added in v2.3.0
func (validator *MockValidator) Deny(p string) error
func (*MockValidator) Validate ¶ added in v2.3.0
func (validator *MockValidator) Validate(p string) error
type ReaderImpl ¶ added in v2.3.0
type ReaderImpl struct {
// contains filtered or unexported fields
}
func NewReader ¶ added in v2.3.0
func NewReader(fs afero.Fs, validator Validator, finder ConfigFinder, reader ConfigReader) *ReaderImpl
func (*ReaderImpl) ReadFromEnv ¶ added in v2.3.0
func (reader *ReaderImpl) ReadFromEnv(policyFilePaths []string) ([]*Config, error)
type Registry ¶
type Registry struct { Name string `json:"name,omitempty"` Type string `validate:"required" json:"type,omitempty" jsonschema:"enum=standard,enum=local,enum=github_content"` RepoOwner string `yaml:"repo_owner" json:"repo_owner,omitempty"` RepoName string `yaml:"repo_name" json:"repo_name,omitempty"` Ref string `json:"ref,omitempty"` Path string `validate:"required" json:"path,omitempty"` }
type ValidatorImpl ¶ added in v2.3.0
type ValidatorImpl struct {
// contains filtered or unexported fields
}
func NewValidator ¶ added in v2.3.0
func NewValidator(param *config.Param, fs afero.Fs) *ValidatorImpl
func (*ValidatorImpl) Allow ¶ added in v2.3.0
func (validator *ValidatorImpl) Allow(p string) error
func (*ValidatorImpl) Deny ¶ added in v2.3.0
func (validator *ValidatorImpl) Deny(p string) error
func (*ValidatorImpl) Validate ¶ added in v2.3.0
func (validator *ValidatorImpl) Validate(p string) error
Click to show internal directories.
Click to hide internal directories.