workflow

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownStatus   = errors.New("unknown job status")
	ErrUnknownWorkflow = errors.New("unknown workflow")
)

Functions

func DeserializeExecutionResult added in v0.0.3

func DeserializeExecutionResult[T ExecutionResult](s SerializedExecutionResult) (*T, error)

Types

type DeprovisionNodeExecutionResult added in v0.0.3

type DeprovisionNodeExecutionResult struct {
	ResourcesFailedToDelete []string `json:"resourcesFailedToDelete,omitempty"`
	Error                   *string  `json:"error,omitempty"`
}

func NewDeprovisionNodeExecutionResult added in v0.0.3

func NewDeprovisionNodeExecutionResult() DeprovisionNodeExecutionResult

func (*DeprovisionNodeExecutionResult) GetError added in v0.0.6

func (r *DeprovisionNodeExecutionResult) GetError() string

func (DeprovisionNodeExecutionResult) Serialize added in v0.0.3

func (*DeprovisionNodeExecutionResult) SetError added in v0.0.6

func (r *DeprovisionNodeExecutionResult) SetError(err string)

type DeprovisionNodeInput added in v0.0.6

type DeprovisionNodeInput struct {
	ExecutionId     string `json:"executionId"`
	NodeId          string `json:"nodeId"`
	Tailnet         string `json:"tailnetName"`
	TailnetDeviceId string `json:"tailnetDeviceId"`
}

func (DeprovisionNodeInput) ExecutionIdentifier added in v0.0.6

func (i DeprovisionNodeInput) ExecutionIdentifier() string

func (*DeprovisionNodeInput) ToJson added in v0.0.6

func (i *DeprovisionNodeInput) ToJson() (string, error)

type Execution

type Execution struct {
	Identifier ExecutionIdentifier
	Workflow   WorkflowName
	Status     Status
	Created    time.Time
	Updated    time.Time
	Finished   *time.Time
	Results    SerializedExecutionResult
}

func NewExecution

func NewExecution(id ExecutionIdentifier, workflow WorkflowName) *Execution

type ExecutionIdentifier

type ExecutionIdentifier string

func ExecutionIdentifierFromString

func ExecutionIdentifierFromString(id string) (ExecutionIdentifier, error)

func FormExecutionIdentifier

func FormExecutionIdentifier(workflow WorkflowName) ExecutionIdentifier

func (ExecutionIdentifier) String

func (id ExecutionIdentifier) String() string

type ExecutionInput added in v0.0.6

type ExecutionInput interface {
	ToJson() (string, error)
	ExecutionIdentifier() string
}

type ExecutionResult added in v0.0.3

type ExecutionResult interface {
	Serialize() (SerializedExecutionResult, error)
}

type ProvisionNodeExecutionResult added in v0.0.3

type ProvisionNodeExecutionResult struct {
	Node  *string `json:"nodeId,omitempty"`
	Error *string `json:"error,omitempty"`
}

func NewProvisionNodeExecutionResult added in v0.0.3

func NewProvisionNodeExecutionResult() ProvisionNodeExecutionResult

func (*ProvisionNodeExecutionResult) GetError added in v0.0.6

func (r *ProvisionNodeExecutionResult) GetError() string

func (ProvisionNodeExecutionResult) GetNode added in v0.0.3

func (ProvisionNodeExecutionResult) Serialize added in v0.0.3

func (*ProvisionNodeExecutionResult) SetError added in v0.0.6

func (r *ProvisionNodeExecutionResult) SetError(err string)

type ProvisionNodeInput added in v0.0.6

type ProvisionNodeInput struct {
	ExecutionId          string `json:"executionId"`
	ProviderName         string `json:"providerName"`
	Location             string `json:"location"`
	TailnetName          string `json:"tailnetName"`
	TailnetControlServer string `json:"tailnetControlServer"`
	Ephemeral            bool   `json:"ephemeral"`
}

func (ProvisionNodeInput) ExecutionIdentifier added in v0.0.6

func (i ProvisionNodeInput) ExecutionIdentifier() string

func (*ProvisionNodeInput) ToJson added in v0.0.6

func (i *ProvisionNodeInput) ToJson() (string, error)

type SerializedExecutionResult added in v0.0.3

type SerializedExecutionResult string

func (SerializedExecutionResult) IsEmpty added in v0.0.3

func (r SerializedExecutionResult) IsEmpty() bool

func (SerializedExecutionResult) String added in v0.0.3

func (r SerializedExecutionResult) String() string

type Status

type Status int
const (
	StatusUnknown Status = iota
	StatusPending
	StatusRunning
	StatusComplete
	StatusFailed
)

func StatusFromString added in v0.0.3

func StatusFromString(s string) (Status, error)

func (Status) String

func (s Status) String() string

type WorkflowName

type WorkflowName int
const (
	WorkflowNameUnknown WorkflowName = iota
	WorkflowNameProvisionNode
	WorkflowNameDeprovisionNode
)

func WorkflowNameFromString

func WorkflowNameFromString(s string) (WorkflowName, error)

func (WorkflowName) String

func (n WorkflowName) String() string

Jump to

Keyboard shortcuts

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