resources

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package downloaders provides the Downloader type which represents the init container that will download a static asset (target) to be scanned.

Copyright (C) 2025 Crash Override, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the FSF, either version 3 of the License, or (at your option) any later version. See the LICENSE file in the root of this repository for full license text or visit: <https://www.gnu.org/licenses/gpl-3.0.html>.

Copyright (C) 2025 Crash Override, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the FSF, either version 3 of the License, or (at your option) any later version. See the LICENSE file in the root of this repository for full license text or visit: <https://www.gnu.org/licenses/gpl-3.0.html>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateParameterDefinitions

func ValidateParameterDefinitions(params map[string]schemas.ParameterDefinition) error

ValidateParameterDefinitions validates the parameter definitions and returns an errs.Error of type errs.TypeBadRequest if any of the parameters are invalid. It will first validate the name of each the parameter using ValidateParameterName and then check if the parameter has a default value if not required.

func ValidateParameterName

func ValidateParameterName(name string) error

ValidateParameterName checks that the parameter name is valid. It will check that the name is not empty, is not longer than 63 characters, and that it only contains alphanumeric characters, underscores, and dashes.

func ValidateParameters

func ValidateParameters(
	req map[string]string,
	parameters map[string]schemas.ParameterDefinition,
) error

ValidateParameters checks that the parameters specified by a user are valid. It will check that the parameters are defined in the parameter definitions and that the required parameters are set.

func ValidateUserContainer

func ValidateUserContainer(
	ctx context.Context,
	clusterCtx cluster.Context,
	ctnr schemas.UserContainer,
) error

It will check that the image is not empty, that the command is not empty,

func ValidateUserContainerWithParameters

func ValidateUserContainerWithParameters(
	ctx context.Context,
	clusterCtx cluster.Context,
	u schemas.UserContainerWithParameters,
) error

ValidateUserContainerWithParameters checks that the UserContainerWithParameters is valid. It will check that the UserContainer is valid and that the parameters are valid. See ValidateUserContainer for more information on validating the UserContainer and ValidateParameterDefinitions for more information on validating the parameters.

Types

type Crawler

type Crawler schemas.Crawler

Crawler see the schemas.Crawler type for more details.

func (Crawler) GetUserContainerWithParameters

func (c Crawler) GetUserContainerWithParameters() schemas.UserContainerWithParameters

func (Crawler) Validate

func (c Crawler) Validate(ctx context.Context, clusterCtx cluster.Context) error

type CrawlerStorageBackend

type CrawlerStorageBackend = storage.Backend[Crawler]

CrawlerStorageBackend is the type of the storage backend used to store Crawler configurations.

func NewCrawlerStorageBackend

func NewCrawlerStorageBackend(clusterCtx cluster.Context) CrawlerStorageBackend

NewCrawlerStorageBackend creates a new CrawlerStorageBackend for the given cluster.Context.

type Downloader

type Downloader schemas.Downloader

Downloader see the schemas.Downloader type for more details.

func (Downloader) GetUserContainer

func (d Downloader) GetUserContainer() schemas.UserContainer

func (Downloader) Validate

func (d Downloader) Validate(ctx context.Context, clusterCtx cluster.Context) error

type DownloaderStorageBackend

type DownloaderStorageBackend = storage.Backend[Downloader]

func NewDownloaderStorageBackend

func NewDownloaderStorageBackend(clusterCtx cluster.Context) DownloaderStorageBackend

type Profile

type Profile schemas.Profile

func (Profile) Validate

func (p Profile) Validate(ctx context.Context, clusterCtx cluster.Context) error

type ProfileStorageBackend

type ProfileStorageBackend = storage.Backend[Profile]

func NewProfileStorageBackend

func NewProfileStorageBackend(clusterCtx cluster.Context) ProfileStorageBackend

type Secret

type Secret schemas.Secret

func (Secret) MarshalText

func (s Secret) MarshalText() (text []byte, err error)

func (*Secret) UnmarshalText

func (s *Secret) UnmarshalText(_ []byte) error

func (*Secret) UnmarshalYAML

func (s *Secret) UnmarshalYAML(node *yaml.Node) error

func (Secret) Validate

func (s Secret) Validate(ctx context.Context, _ cluster.Context) error

type SecretStorageBackend

type SecretStorageBackend = storage.Backend[Secret]

func NewSecretStorageBackend

func NewSecretStorageBackend(clusterCtx cluster.Context) SecretStorageBackend

type Uploader

func (Uploader) GetUserContainerWithParameters

func (u Uploader) GetUserContainerWithParameters() schemas.UserContainerWithParameters

func (Uploader) Validate

func (u Uploader) Validate(ctx context.Context, clusterCtx cluster.Context) error

type UploaderStorageBackend

type UploaderStorageBackend = storage.Backend[Uploader]

func NewUploaderStorageBackend

func NewUploaderStorageBackend(clusterCtx cluster.Context) UploaderStorageBackend

Jump to

Keyboard shortcuts

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