policy

package
v1.25.1-6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnv

func ParseEnv(env string) []string

Types

type Checker

type Checker struct{}

func NewChecker

func NewChecker() *Checker

func (*Checker) ValidatePackage

func (pc *Checker) ValidatePackage(param *ParamValidatePackage) error

type Config

type Config struct {
	Path string
	YAML *ConfigYAML
}

func (*Config) Init

func (cfg *Config) Init() error

type ConfigReader

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

func NewConfigReader

func NewConfigReader(fs afero.Fs) *ConfigReader

func (*ConfigReader) Read

func (reader *ConfigReader) Read(files []string) ([]*Config, error)

type ConfigYAML

type ConfigYAML struct {
	Registries []*Registry `json:"registries"`
	Packages   []*Package  `json:"packages,omitempty"`
}

type Package

type Package struct {
	Name         string    `json:"name"`
	Version      string    `json:"version,omitempty"`
	RegistryName string    `yaml:"registry" json:"registry,omitempty"`
	Registry     *Registry `yaml:"-" json:"-"`
}

type ParamValidatePackage

type ParamValidatePackage struct {
	Pkg           *config.Package
	PolicyConfigs []*Config
}

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"`
}

Jump to

Keyboard shortcuts

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