Documentation ¶
Index ¶
- Variables
- func SetLogger(l logr.Logger)
- type ApiObjectStore
- func (aos *ApiObjectStore) ExpectedProvider() *ExpectedProvider
- func (aos *ApiObjectStore) GetProjects() []*api.Project
- func (aos *ApiObjectStore) GetRegistries() []*api.Registry
- func (aos *ApiObjectStore) GetScanners() []*api.Scanner
- func (aos *ApiObjectStore) RemoveManifest(filename string) error
- func (aos *ApiObjectStore) WriteManifest(filename string, obj runtime.Object) error
- type ExpectedProvider
Constants ¶
This section is empty.
Variables ¶
var ErrValidationGroupWithoutDN error = errors.New("validation error: project group member with missing DN field")
ErrValidationScannerNameReference error indicates that a project refers to a non-existing Scanner.
var ErrValidationInvalidLocalRegistryInProject error = errors.New("validation error: project contains invalid registry name")
ErrValidationInvalidLocalRegistryInProject error indicates that a local project refers to a non-existing registry.
var ErrValidationMultipleGlobalRegistries error = errors.New("validation error: multiple global registries found")
ErrValidationMultipleGlobalRegistries error indicates that there are multiple global registries configured.
var ErrValidationProjectNameNotUnique error = errors.New("validation error: multiple projects present with the same name")
ErrValidationProjectNameNotUnique error indicates that there are multiple projects configured with the same name.
var ErrValidationRegistryNameNotUnique error = errors.New("validation error: multiple registries present with the same name")
ErrValidationRegistryNameNotUnique error indicates that there are multiple registries configured with the same name.
var ErrValidationScannerNameNotUnique error = errors.New("validation error: multiple scanners present with the same name")
ErrValidationScannerNameNotUnique error indicates that there are multiple scanners configured with the same name.
var ErrValidationScannerNameReference error = errors.New("validation error: multiple registries present with the same name")
ErrValidationScannerNameReference error indicates that a project refers to a non-existing Scanner.
Functions ¶
Types ¶
type ApiObjectStore ¶
type ApiObjectStore struct {
// contains filtered or unexported fields
}
ApiObjectStore is the database of the configured resources (Projects, Registries and Scanners).
func ReadManifests ¶
func ReadManifests(path string) (*ApiObjectStore, error)
ReadManifests creates a new ApiObjectStore. It reads all files under path. The files are deserialized and validated.
func (*ApiObjectStore) ExpectedProvider ¶
func (aos *ApiObjectStore) ExpectedProvider() *ExpectedProvider
ExpectedProvider method turns an ApiObjectStore into an ExpectedProvider.
func (*ApiObjectStore) GetProjects ¶
func (aos *ApiObjectStore) GetProjects() []*api.Project
GetProjects returns the parsed projects as API objects.
func (*ApiObjectStore) GetRegistries ¶
func (aos *ApiObjectStore) GetRegistries() []*api.Registry
GetRegistries returns the parsed registries as API objects.
func (*ApiObjectStore) GetScanners ¶
func (aos *ApiObjectStore) GetScanners() []*api.Scanner
GetScanners returns the parsed scanners as API objects.
func (*ApiObjectStore) RemoveManifest ¶
func (aos *ApiObjectStore) RemoveManifest(filename string) error
RemoveManifest removes the file from the filesystem. The path where the file is removed from is set when the ReadManifests function creates the ApiObjectStore.
func (*ApiObjectStore) WriteManifest ¶
func (aos *ApiObjectStore) WriteManifest(filename string, obj runtime.Object) error
WriteManifest serializes the object specified by the obj parameter. The filename parameter specifies the name of the file to be created. The path where the file is created is set when the ReadManifests function creates the ApiObjectStore.
type ExpectedProvider ¶
type ExpectedProvider ApiObjectStore
ExpectedProvider is a database of the resources which implement the interfaces defines in the globalregistry package.
The resources in the database usually show the expected state of the resources.
func (*ExpectedProvider) GetRegistries ¶
func (expp *ExpectedProvider) GetRegistries() []*registry.Registry
GetRegistries returns the Registries of the resource database.
func (*ExpectedProvider) GetRegistryByName ¶
func (expp *ExpectedProvider) GetRegistryByName(name string) *registry.Registry
GetRegistryByName returns a Registry with the given name from the database. If no Registry if found with the specified name, nil is returned.