Documentation
¶
Index ¶
- Constants
- func EnvForChildJobBroker(b ChildJobBroker) map[string]string
- func EnvForCurrent(c Current) map[string]string
- func MergeProtectedEnv(base map[string]string, protected map[string]string) map[string]string
- type ChildJobBroker
- type Current
- type Parent
- type StartedJobContext
- type StartedJobsContext
Constants ¶
View Source
const ( CurrentContextVersionEnv = "C2J_CURRENT_CONTEXT_VERSION" CurrentTenantIDEnv = "C2J_CURRENT_TENANT_ID" CurrentGoalIDEnv = "C2J_CURRENT_GOAL_ID" CurrentJobIDEnv = "C2J_CURRENT_JOB_ID" CurrentJobTypeEnv = "C2J_CURRENT_JOB_TYPE" CurrentOpTypeEnv = "C2J_CURRENT_OP_TYPE" CurrentOpStepEnv = "C2J_CURRENT_OP_STEP" CurrentOpTaskTypeEnv = "C2J_CURRENT_OP_TASK_TYPE" CurrentCellNameEnv = "C2J_CURRENT_CELL_NAME" CurrentRepositorySourceEnv = "C2J_CURRENT_REPOSITORY_SOURCE" CurrentGitRefEnv = "C2J_CURRENT_GIT_REF" CurrentInvocationPathEnv = "C2J_CURRENT_INVOCATION_PATH" CurrentInvocationSequenceEnv = "C2J_CURRENT_INVOCATION_SEQUENCE" CurrentInvocationHashEnv = "C2J_CURRENT_INVOCATION_HASH" ChildJobEndpointEnv = "C2J_CHILD_JOB_ENDPOINT" ChildJobTokenEnv = "C2J_CHILD_JOB_TOKEN" ChildJobSessionIDEnv = "C2J_CHILD_JOB_SESSION_ID" // TenantIDEnv is kept as a convenience for child tools that still consume a // tenant-only environment default. The current c2j CLI resolves through // C2J_JOBDB instead. TenantIDEnv = "C2J_TENANT_ID" CurrentContextVersion = "1" )
Variables ¶
This section is empty.
Functions ¶
func EnvForChildJobBroker ¶
func EnvForChildJobBroker(b ChildJobBroker) map[string]string
func EnvForCurrent ¶
Types ¶
type ChildJobBroker ¶
type ChildJobBroker struct {
Endpoint string `json:"endpoint,omitempty"`
Token string `json:"token,omitempty"`
SessionID string `json:"session_id,omitempty"`
}
func ChildJobBrokerFromEnv ¶
func ChildJobBrokerFromEnv(getenv func(string) string) (ChildJobBroker, bool, error)
type Current ¶
type Current struct {
GoalID string `json:"goal_id"`
TenantID string `json:"tenant_id,omitempty"`
JobID string `json:"job_id,omitempty"`
JobType string `json:"job_type,omitempty"`
OpType string `json:"op_type,omitempty"`
OpStep string `json:"op_step,omitempty"`
OpTaskType string `json:"op_task_type,omitempty"`
CellName string `json:"cell_name,omitempty"`
RepositorySource string `json:"repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
InvocationPath string `json:"invocation_path,omitempty"`
InvocationSequence int64 `json:"invocation_seq,omitempty"`
InvocationHash string `json:"invocation_hash,omitempty"`
}
type Parent ¶
type Parent struct {
GoalID string `json:"goal_id"`
TenantID string `json:"tenant_id,omitempty"`
JobID string `json:"job_id,omitempty"`
JobType string `json:"job_type,omitempty"`
OpType string `json:"op_type,omitempty"`
OpStep string `json:"op_step,omitempty"`
OpTaskType string `json:"op_task_type,omitempty"`
CellName string `json:"cell_name,omitempty"`
RepositorySource string `json:"repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
InvocationPath string `json:"invocation_path,omitempty"`
InvocationSequence int64 `json:"invocation_seq,omitempty"`
InvocationHash string `json:"invocation_hash,omitempty"`
}
func ParentFromCurrent ¶
type StartedJobContext ¶
type StartedJobContext struct {
GoalID string `json:"goal_id"`
TenantID string `json:"tenant_id,omitempty"`
JobID string `json:"job_id,omitempty"`
RecipeName string `json:"recipe,omitempty"`
Status string `json:"status,omitempty"`
ParentInvocationHash string `json:"parent_invocation_hash,omitempty"`
}
type StartedJobsContext ¶
type StartedJobsContext struct {
GoalIDs []string `json:"goal_ids"`
JobIDs []string `json:"job_ids"`
Items []StartedJobContext `json:"items"`
}
func EmptyStartedJobsContext ¶
func EmptyStartedJobsContext() StartedJobsContext
func MergeStartedJobs ¶ added in v0.0.94
func MergeStartedJobs(groups ...StartedJobsContext) (StartedJobsContext, error)
MergeStartedJobs preserves complete identity records; projections are derived together so their indexes always refer to the same submitted child.
Click to show internal directories.
Click to hide internal directories.