Documentation
¶
Index ¶
Constants ¶
const ( RunIfSuccess = "success" RunIfFailure = "failure" )
const ( JobStatusPending = "pending" JobStatusRunning = "running" JobStatusCompleted = "completed" JobStatusFailed = "failed" JobStatusUnknown = "unknown" )
const ( ElasticWasiSecurity = "wasi_security" ElasticWasiPEP = "wasi_pep" )
Keys recognised inside MetadataElasticKey.
const MetadataElasticKey = "elastic"
MetadataElasticKey is the metadata sub-map reserved for ELASTIC project configuration. Unlike the rest of Metadata, which is opaque to everything but the manager's list filter, keys under it are interpreted by the proplet and are the only part of Metadata forwarded on the start payload. Nesting them keeps a free-form user label from silently changing how a task is sandboxed.
Variables ¶
var ElasticKeys = []string{ElasticWasiSecurity, ElasticWasiPEP}
ElasticKeys lists every key the proplet reads out of MetadataElasticKey.
var ErrInvalidJobStatus = errors.New("invalid job status")
Functions ¶
This section is empty.
Types ¶
type FlexStrings ¶
type FlexStrings []string
func (*FlexStrings) UnmarshalJSON ¶
func (f *FlexStrings) UnmarshalJSON(data []byte) error
type Task ¶
type Task struct {
ID string `json:"id"`
Name string `json:"name"`
Kind TaskKind `json:"kind,omitempty"`
State State `json:"state"`
ImageURL string `json:"image_url,omitempty"`
File []byte `json:"file,omitempty"`
CLIArgs []string `json:"cli_args"`
Inputs FlexStrings `json:"inputs,omitempty"`
Env map[string]string `json:"env,omitempty"`
Daemon bool `json:"daemon"`
Latent bool `json:"latent,omitempty"`
Encrypted bool `json:"encrypted"`
KBSResourcePath string `json:"kbs_resource_path,omitempty"`
PropletID string `json:"proplet_id,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
RunIf string `json:"run_if,omitempty"`
WorkflowID string `json:"workflow_id,omitempty"`
JobID string `json:"job_id,omitempty"`
Results any `json:"results,omitempty"`
Error string `json:"error,omitempty"`
MonitoringProfile *proplet.MonitoringProfile `json:"monitoring_profile,omitempty"`
StartTime time.Time `json:"start_time"`
FinishTime time.Time `json:"finish_time"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Mode Mode `json:"mode,omitempty"`
Schedule string `json:"schedule,omitempty"`
NextRun time.Time `json:"next_run"`
IsRecurring bool `json:"is_recurring,omitempty"`
Timezone string `json:"timezone,omitempty"`
Broadcast bool `json:"broadcast,omitempty"`
Priority int `json:"priority,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
HalStoragePath *string `json:"hal_storage_path,omitempty"`
}
func (Task) ElasticConfig ¶ added in v0.6.0
ElasticConfig returns the reserved MetadataElasticKey sub-map, or nil when the task carries none. Values survive a JSON round-trip through storage as map[string]any, so the assertion holds for both freshly decoded requests and tasks loaded from the repository.