{"modulePath":"github.com/cloudfoundry/executor","version":"v0.0.0-20260626172623-1f62bb75b686","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Constants\n\n```go\nconst (\n\tContainerOwnerProperty = \"executor:owner\"\n\tContainerStateProperty = \"garden.state\"\n)\n```\n\n```go\nconst (\n\tHealthcheckTag      = \"executor-healthcheck\"\n\tHealthcheckTagValue = \"executor-healthcheck\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrContainerGuidNotAvailable      = registerError(\"ContainerGuidNotAvailable\", \"container guid not available\")\n\tErrContainerNotCompleted          = registerError(\"ContainerNotCompleted\", \"container must be stopped before it can be deleted\")\n\tErrInsufficientResourcesAvailable = registerError(\"InsufficientResourcesAvailable\", \"insufficient resources available\")\n\tErrContainerNotFound              = registerError(\"ContainerNotFound\", \"container not found\")\n\tErrStepsInvalid                   = registerError(\"StepsInvalid\", \"steps invalid\")\n\tErrLimitsInvalid                  = registerError(\"LimitsInvalid\", \"container limits invalid\")\n\tErrGuidNotSpecified               = registerError(\"GuidNotSpecified\", \"container guid not specified\")\n\tErrInvalidTransition              = registerError(\"InvalidStateTransition\", \"container cannot transition to given state\")\n\tErrFailureToCheckSpace            = registerError(\"ErrFailureToCheckSpace\", \"failed to check available space\")\n\tErrInvalidSecurityGroup           = registerError(\"ErrInvalidSecurityGroup\", \"security group has invalid values\")\n\tErrNoProcessToStop                = registerError(\"ErrNoProcessToStop\", \"failed to find a process to stop\")\n)\n```\n\n```go\nvar ErrUnknownEventType = errors.New(\"unknown event type\")\n```\n\n```go\nvar Errors = map[string]Error{}\n```\n\n## Functions\n\n```go\nfunc EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable\n```\n\n## Types\n\n```go\ntype AllocationFailure struct {\n\tAllocationRequest\n\tErrorMsg string\n}\n```\n\n```go\nfunc NewAllocationFailure(req *AllocationRequest, msg string) AllocationFailure\n```\n\n```go\nfunc (fail *AllocationFailure) Error() string\n```\n\n```go\ntype AllocationRequest struct {\n\tGuid               string\n\tGenerateLogMetrics bool\n\tResource\n\tTags\n}\n```\n\n```go\nfunc NewAllocationRequest(guid string, resource *Resource, generateLogMetrics bool, tags Tags) AllocationRequest\n```\n\n```go\nfunc (a *AllocationRequest) Validate() error\n```\n\n```go\ntype BindMountMode uint8\n```\n\n```go\nconst (\n\tBindMountModeRO BindMountMode = 0\n\tBindMountModeRW BindMountMode = 1\n)\n```\n\n```go\ntype CachedDependency struct {\n\tName              string `json:\"name\"`\n\tFrom              string `json:\"from\"`\n\tTo                string `json:\"to\"`\n\tCacheKey          string `json:\"cache_key\"`\n\tLogSource         string `json:\"log_source\"`\n\tChecksumValue     string `json:\"checksum_value\"`\n\tChecksumAlgorithm string `json:\"checksum_algorithm\"`\n}\n```\n\n```go\ntype CertificateProperties struct {\n\tOrganizationalUnit []string `json:\"organizational_unit\"`\n}\n```\n\n```go\ntype CheckProtocol int\n```\n\n```go\nconst (\n\tHTTPCheck CheckProtocol = iota\n\tTCPCheck\n)\n```\n\n```go\nfunc (c CheckProtocol) String() string\n```\n\n```go\ntype Client interface {\n\tPing(logger lager.Logger) error\n\tAllocateContainers(logger lager.Logger, traceID string, requests []AllocationRequest) []AllocationFailure\n\tGetContainer(logger lager.Logger, guid string) (Container, error)\n\tRunContainer(lager.Logger, string, *RunRequest) error\n\tUpdateContainer(lager.Logger, *UpdateRequest) error\n\tStopContainer(logger lager.Logger, traceID string, guid string) error\n\tDeleteContainer(logger lager.Logger, traceID string, guid string) error\n\tListContainers(lager.Logger) ([]Container, error)\n\tGetBulkMetrics(lager.Logger) (map[string]Metrics, error)\n\tRemainingResources(lager.Logger) (ExecutorResources, error)\n\tTotalResources(lager.Logger) (ExecutorResources, error)\n\tGetFiles(logger lager.Logger, guid string, path string) (io.ReadCloser, error)\n\tVolumeDrivers(logger lager.Logger) ([]string, error)\n\tSubscribeToEvents(lager.Logger) (EventSource, error)\n\tHealthy(lager.Logger) bool\n\tSetHealthy(lager.Logger, bool)\n\tCleanup(lager.Logger)\n}\n```\n\n```go\ntype Container struct {\n\tGuid string `json:\"guid\"`\n\tResource\n\tRunInfo\n\tTags                                  Tags\n\tState                                 State              `json:\"state\"`\n\tRoutable                              bool               `json:\"routable\"`\n\tAllocatedAt                           int64              `json:\"allocated_at\"`\n\tExternalIP                            string             `json:\"external_ip\"`\n\tInternalIP                            string             `json:\"internal_ip\"`\n\tInternalIPv6                          string             `json:\"internal_ip_v6,omitempty\"`\n\tRunResult                             ContainerRunResult `json:\"run_result\"`\n\tMemoryLimit                           uint64             `json:\"memory_limit\"`\n\tDiskLimit                             uint64             `json:\"disk_limit\"`\n\tAdvertisePreferenceForInstanceAddress bool               `json:\"advertise_preference_for_instance_address\"`\n}\n```\n\n```go\nfunc NewContainerFromResource(guid string, resource *Resource, tags Tags) Container\n```\n\n```go\nfunc NewReservedContainerFromAllocationRequest(req *AllocationRequest, allocatedAt int64) Container\n```\n\n```go\nfunc (newContainer Container) Copy() Container\n```\n\n```go\nfunc (c *Container) HasTags(tags Tags) bool\n```\n\n```go\nfunc (c *Container) IsCreated() bool\n```\n\n```go\nfunc (c *Container) TransitionToComplete(failed bool, failureReason string, retryable bool)\n```\n\n```go\nfunc (c *Container) TransitionToCreate() error\n```\n\n```go\nfunc (c *Container) TransitionToInitialize(req *RunRequest) error\n```\n\n```go\nfunc (c *Container) ValidateTransitionTo(newState State) bool\n```\n\n```go\ntype ContainerCompleteEvent struct {\n\tRawContainer Container `json:\"container\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewContainerCompleteEvent(container Container, traceID string) ContainerCompleteEvent\n```\n\n```go\nfunc (e ContainerCompleteEvent) Container() Container\n```\n\n```go\nfunc (ContainerCompleteEvent) EventType() EventType\n```\n\n```go\nfunc (e ContainerCompleteEvent) TraceID() string\n```\n\n```go\ntype ContainerMetrics struct {\n\tMemoryUsageInBytes                  uint64        `json:\"memory_usage_in_bytes\"`\n\tDiskUsageInBytes                    uint64        `json:\"disk_usage_in_bytes\"`\n\tMemoryLimitInBytes                  uint64        `json:\"memory_limit_in_bytes\"`\n\tDiskLimitInBytes                    uint64        `json:\"disk_limit_in_bytes\"`\n\tTimeSpentInCPU                      time.Duration `json:\"time_spent_in_cpu\"`\n\tAbsoluteCPUEntitlementInNanoseconds uint64        `json:\"absolute_cpu_entitlement_in_ns\"`\n\tContainerAgeInNanoseconds           uint64        `json:\"container_age_in_ns\"`\n\tRxInBytes                           *uint64       `json:\"rx_in_bytes\"`\n\tTxInBytes                           *uint64       `json:\"tx_in_bytes\"`\n}\n```\n\n```go\ntype ContainerReservedEvent struct {\n\tRawContainer Container `json:\"container\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewContainerReservedEvent(container Container, traceID string) ContainerReservedEvent\n```\n\n```go\nfunc (e ContainerReservedEvent) Container() Container\n```\n\n```go\nfunc (ContainerReservedEvent) EventType() EventType\n```\n\n```go\nfunc (e ContainerReservedEvent) TraceID() string\n```\n\n```go\ntype ContainerRunResult struct {\n\tFailed        bool   `json:\"failed\"`\n\tFailureReason string `json:\"failure_reason\"`\n\tRetryable     bool\n\n\tStopped bool `json:\"stopped\"`\n}\n```\n\n```go\ntype ContainerRunningEvent struct {\n\tRawContainer Container `json:\"container\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewContainerRunningEvent(container Container, traceID string) ContainerRunningEvent\n```\n\n```go\nfunc (e ContainerRunningEvent) Container() Container\n```\n\n```go\nfunc (ContainerRunningEvent) EventType() EventType\n```\n\n```go\nfunc (e ContainerRunningEvent) TraceID() string\n```\n\n```go\ntype EnvironmentVariable struct {\n\tName  string `json:\"name\"`\n\tValue string `json:\"value\"`\n}\n```\n\n```go\nfunc EnvironmentVariablesFromModel(envVars []*models.EnvironmentVariable) []EnvironmentVariable\n```\n\n```go\ntype Error interface {\n\terror\n\n\tName() string\n}\n```\n\n```go\ntype Event interface {\n\tEventType() EventType\n}\n```\n\n```go\ntype EventSource interface {\n\tNext() (Event, error)\n\tClose() error\n}\n```\n\n```go\ntype EventType string\n```\n\n```go\nconst (\n\tEventTypeInvalid EventType = \"\"\n\n\tEventTypeContainerComplete EventType = \"container_complete\"\n\tEventTypeContainerRunning  EventType = \"container_running\"\n\tEventTypeContainerReserved EventType = \"container_reserved\"\n)\n```\n\n```go\ntype ExecutorResources struct {\n\tMemoryMB   int `json:\"memory_mb\"`\n\tDiskMB     int `json:\"disk_mb\"`\n\tContainers int `json:\"containers\"`\n}\n```\n\n```go\nfunc NewExecutorResources(memoryMB, diskMB, containers int) ExecutorResources\n```\n\n```go\nfunc (r *ExecutorResources) Add(res *Resource)\n```\n\n```go\nfunc (e ExecutorResources) Copy() ExecutorResources\n```\n\n```go\nfunc (r *ExecutorResources) Subtract(res *Resource) bool\n```\n\n```go\ntype HealthcheckType int\n```\n\n```go\nconst (\n\tIsStartupCheck HealthcheckType = iota\n\tIsLivenessCheck\n\tIsUntilSuccessReadinessCheck\n\tIsUntilFailureReadinessCheck\n)\n```\n\n```go\nfunc (h HealthcheckType) String() string\n```\n\n```go\ntype InnerContainer Container\n```\n\n```go\ntype LifecycleEvent interface {\n\tTraceID() string\n\tContainer() Container\n\t// contains filtered or unexported methods\n}\n```\n\n```go\ntype LogConfig = models.LogConfig\n```\nDeprecated: use code.cloudfoundry.org/bbs/models.LogConfig instead. This alias will be removed once silk-release has migrated.\n\n```go\ntype Metrics struct {\n\tMetricsConfig\n\tContainerMetrics\n}\n```\n\n```go\ntype MetricsConfig struct {\n\tGuid  string            `json:\"guid\"`\n\tIndex int               `json:\"index\"`\n\tTags  map[string]string `json:\"tags\"`\n}\n```\n\n```go\ntype Network struct {\n\tProperties map[string]string `json:\"properties,omitempty\"`\n}\n```\n\n```go\ntype PortMapping struct {\n\tContainerPort         uint16 `json:\"container_port\"`\n\tHostPort              uint16 `json:\"host_port,omitempty\"`\n\tContainerTLSProxyPort uint16 `json:\"container_tls_proxy_port,omitempty\"`\n\tHostTLSProxyPort      uint16 `json:\"host_tls_proxy_port,omitempty\"`\n}\n```\n\n```go\ntype ProxyPortMapping struct {\n\tAppPort   uint16 `json:\"app_port\"`\n\tProxyPort uint16 `json:\"proxy_port\"`\n}\n```\n\n```go\ntype Resource struct {\n\tMemoryMB int `json:\"memory_mb\"`\n\tDiskMB   int `json:\"disk_mb\"`\n\tMaxPids  int `json:\"max_pids\"`\n}\n```\n\n```go\nfunc NewResource(memoryMB, diskMB, maxPids int) Resource\n```\n\n```go\ntype RunInfo struct {\n\tRootFSPath                    string                      `json:\"rootfs\"`\n\tCPUWeight                     uint                        `json:\"cpu_weight\"`\n\tPorts                         []PortMapping               `json:\"ports\"`\n\tInternalRoutes                models.InternalRoutes       `json:\"internal_routes\"`\n\tLogConfig                     LogConfig                   `json:\"log_config\"`\n\tMetricsConfig                 MetricsConfig               `json:\"metrics_config\"`\n\tStartTimeoutMs                uint                        `json:\"start_timeout_ms\"`\n\tPrivileged                    bool                        `json:\"privileged\"`\n\tCachedDependencies            []CachedDependency          `json:\"cached_dependencies\"`\n\tSetup                         *models.Action              `json:\"setup\"`\n\tAction                        *models.Action              `json:\"run\"`\n\tMonitor                       *models.Action              `json:\"monitor\"`\n\tCheckDefinition               *models.CheckDefinition     `json:\"check_definition\"`\n\tEgressRules                   []*models.SecurityGroupRule `json:\"egress_rules,omitempty\"`\n\tEnv                           []EnvironmentVariable       `json:\"env,omitempty\"`\n\tTrustedSystemCertificatesPath string                      `json:\"trusted_system_certificates_path,omitempty\"`\n\tVolumeMounts                  []VolumeMount               `json:\"volume_mounts\"`\n\tNetwork                       *Network                    `json:\"network,omitempty\"`\n\tCertificateProperties         CertificateProperties       `json:\"certificate_properties\"`\n\tImageUsername                 string                      `json:\"image_username\"`\n\tImagePassword                 string                      `json:\"image_password\"`\n\tEnableContainerProxy          bool                        `json:\"enable_container_proxy\"`\n\tSidecars                      []Sidecar                   `json:\"sidecars\"`\n\tLogRateLimitBytesPerSecond    int64                       `json:\"log_rate_limit_bytes_per_second\"`\n\tVolumeMountedFiles            []VolumeMountedFiles        `json:\"volume_mounted_files,omitempty\"`\n}\n```\n\n```go\ntype RunRequest struct {\n\tGuid string\n\tRunInfo\n\tTags\n}\n```\n\n```go\nfunc NewRunRequest(guid string, runInfo *RunInfo, tags Tags) RunRequest\n```\n\n```go\ntype Sidecar struct {\n\tAction   *models.Action `json:\"run\"`\n\tDiskMB   int32          `json:\"disk_mb\"`\n\tMemoryMB int32          `json:\"memory_mb\"`\n}\n```\n\n```go\ntype State string\n```\n\n```go\nconst (\n\tStateInvalid      State = \"\"\n\tStateReserved     State = \"reserved\"\n\tStateInitializing State = \"initializing\"\n\tStateCreated      State = \"created\"\n\tStateRunning      State = \"running\"\n\tStateCompleted    State = \"completed\"\n)\n```\n\n```go\ntype Tags map[string]string\n```\n\n```go\nfunc (t Tags) Add(other Tags)\n```\n\n```go\nfunc (t Tags) Copy() Tags\n```\n\n```go\ntype UpdateRequest struct {\n\tGuid           string\n\tInternalRoutes bbsmodels.InternalRoutes\n\tMetricTags     map[string]string\n}\n```\n\n```go\nfunc NewUpdateRequest(guid string, internalRoutes bbsmodels.InternalRoutes, metricTags map[string]string) UpdateRequest\n```\n\n```go\ntype VolumeMount struct {\n\tDriver        string                 `json:\"driver\"`\n\tVolumeId      string                 `json:\"volume_id\"`\n\tConfig        map[string]interface{} `json:\"config\"`\n\tContainerPath string                 `json:\"container_path\"`\n\tMode          BindMountMode          `json:\"mode\"`\n}\n```\n\n```go\ntype VolumeMountedFiles struct {\n\tPath    string `json:\"path\"`\n\tContent string `json:\"content\"`\n}\n```\n\n```go\nfunc VolumeMountedFilesFromModel(envFiles []*models.File) []VolumeMountedFiles\n```\n\n","path":"github.com/cloudfoundry/executor","name":"executor","synopsis":"","isRedistributable":true}
