backend

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CheckIDVar          = "VULCAN_CHECK_ID"
	ChecktypeNameVar    = "VULCAN_CHECKTYPE_NAME"
	ChecktypeVersionVar = "VULCAN_CHECKTYPE_VERSION"
	CheckTargetVar      = "VULCAN_CHECK_TARGET"
	CheckAssetTypeVar   = "VULCAN_CHECK_ASSET_TYPE"
	CheckOptionsVar     = "VULCAN_CHECK_OPTIONS"
	CheckLogLevelVar    = "VULCAN_CHECK_LOG_LVL"
	AgentAddressVar     = "VULCAN_AGENT_ADDRESS"
)

Constants defining environment variables that a check expects.

Variables

View Source
var ErrNonZeroExitCode = errors.New("container finished unexpectedly")

ErrNonZeroExitCode is returned by the docker backend when a container finished with an exit code different from 0.

Functions

func ParseImage

func ParseImage(image string) (domain, path, tag string, err error)

ParseImage validates and enrich the image with domain (docker.io if domain missing), tag (latest if missing),.

Types

type APIConfig

type APIConfig struct {
	Port  string `json:"port"`               // Port where the api for for the check should listen on
	IName string `json:"iname" toml:"iname"` // Interface name that defines the ip a check should use to reach the agent api.
	Host  string `json:"host" toml:"host"`   // Hostname a check should use to reach the agent. Overrides the IName config param.
}

APIConfig defines address where a component of the agent will be listening to the http requests sent by the checks running.

type Backend

type Backend interface {
	Run(ctx context.Context, params RunParams) (<-chan RunResult, error)
}

Backend defines the shape of the backend that executes checks.

type CheckVars

type CheckVars = map[string]string

CheckVars contains the static checks vars that some checks needs to be injected in their docker to run.

type RunParams

type RunParams struct {
	CheckID          string
	CheckTypeName    string
	ChecktypeVersion string
	Image            string
	Target           string
	AssetType        string
	Options          string
	RequiredVars     []string
	Metadata         map[string]string
}

type RunResult

type RunResult struct {
	Output []byte
	Error  error
}

RunResult defines the info that must be returned when a check is finished.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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