Documentation ¶
Index ¶
- Constants
- Variables
- func GetValueFromMap(obj map[string]any, fromPath ...string) (any, bool)
- func SetValueToMap(obj map[string]any, toVal any, toPath ...string)
- type Box
- type BoxResource
- type BoxStatus
- type Build
- type BytesSize
- type Data
- type DockerAuth
- type DockerAuths
- type EmptyDirVolume
- type EnvVar
- type EnvVarSource
- type Flow
- type HostPathVolume
- type ListOption
- type Metadata
- func (m *Metadata) GetCreationTimestamp() time.Time
- func (m *Metadata) GetDeletionTimestamp() *time.Time
- func (m *Metadata) GetKind() string
- func (m *Metadata) GetLabels() map[string]string
- func (m *Metadata) GetName() string
- func (m *Metadata) GetNamespace() string
- func (m *Metadata) SetCreationTimestamp(timestamp time.Time)
- func (m *Metadata) SetDeletionTimestamp(timestamp *time.Time)
- func (m *Metadata) SetKind(kind string)
- func (m *Metadata) SetLabels(labels map[string]string)
- func (m *Metadata) SetName(name string)
- func (m *Metadata) SetNamespace(namespace string)
- func (m *Metadata) String() string
- type Object
- type Pagination
- type Phase
- type Platform
- type PullPolicy
- type Secret
- type SecretKeySelector
- type Stage
- type Step
- type StorageMedium
- type UnstructuredObject
- func (o *UnstructuredObject) GetCreationTimestamp() time.Time
- func (o *UnstructuredObject) GetDeletionTimestamp() *time.Time
- func (o *UnstructuredObject) GetKind() string
- func (o *UnstructuredObject) GetLabels() map[string]string
- func (o *UnstructuredObject) GetName() string
- func (o *UnstructuredObject) GetNamespace() string
- func (o *UnstructuredObject) MarshalJSON() ([]byte, error)
- func (o *UnstructuredObject) MarshalYAML() ([]byte, error)
- func (o *UnstructuredObject) SetCreationTimestamp(timestamp time.Time)
- func (o *UnstructuredObject) SetDeletionTimestamp(timestamp *time.Time)
- func (o *UnstructuredObject) SetKind(kind string)
- func (o *UnstructuredObject) SetLabels(labels map[string]string)
- func (o *UnstructuredObject) SetName(name string)
- func (o *UnstructuredObject) SetNamespace(namespace string)
- func (o *UnstructuredObject) ToObject(v Object) error
- func (o *UnstructuredObject) UnmarshalJSON(data []byte) error
- func (o *UnstructuredObject) UnmarshalYAML(value *yaml.Node) error
- type Volume
- type VolumeDevice
- type VolumeMount
- type Worker
- type WorkerKind
- type Workflow
- type WorkflowSpec
Constants ¶
View Source
const ( DefaultNamespace = "default" AllNamespace = "" )
View Source
const ( KindBox = "Box" KindWorkflow = "Workflow" KindSecret = "Secret" )
View Source
const ( StatusEnable = "enable" StatusDisable = "disable" )
View Source
const DockerConfigJSONKey = ".dockerconfigjson"
View Source
const LabelStatus = "ink.io/status"
Variables ¶
View Source
var ErrCanceled = errors.New("canceled")
Functions ¶
Types ¶
type Box ¶
type Box struct { Metadata `yaml:",inline"` Resources []BoxResource `json:"resources" yaml:"resources"` Settings map[string]string `json:"settings,omitempty" yaml:"settings,omitempty"` Status BoxStatus `json:"status,omitempty" yaml:"status,omitempty"` }
Box defines a collection of stage executions.
func (*Box) GetSelectors ¶
type BoxResource ¶
type BoxResource struct { Kind string `json:"kind" yaml:"kind"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Selector *selector.Selector `json:"selector,omitempty" yaml:"selector,omitempty"` LabelSelector *selector.Selector `json:"labelSelector,omitempty" yaml:"labelSelector,omitempty"` }
type Build ¶
type Build struct { ID uint64 `json:"id" yaml:"id"` BoxID uint64 `json:"boxID" yaml:"boxID"` Number uint64 `json:"number" yaml:"number"` Phase Phase `json:"phase" yaml:"phase"` Title string `json:"title" yaml:"title"` Message string `json:"message,omitempty" yaml:"message,omitempty"` Settings map[string]string `json:"settings,omitempty" yaml:"settings,omitempty"` Started int64 `json:"started,omitempty" yaml:"started,omitempty"` Stopped int64 `json:"stopped,omitempty" yaml:"stopped,omitempty"` Stages []*Stage `json:"stages,omitempty" yaml:"stages,omitempty"` }
type BytesSize ¶
type BytesSize int64
BytesSize stores a human-readable size in bytes, kibibytes, mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB").
type DockerAuth ¶
type DockerAuth struct { Auth string `json:"auth" yaml:"auth"` Username string `json:"username,omitempty" yaml:"username,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty"` }
func (*DockerAuth) Decrypt ¶
func (da *DockerAuth) Decrypt() error
func (*DockerAuth) Encrypt ¶
func (da *DockerAuth) Encrypt()
type DockerAuths ¶
type DockerAuths struct {
Auths map[string]DockerAuth `json:"auths" yaml:"auths"`
}
func (*DockerAuths) Match ¶
func (das *DockerAuths) Match(image string) string
type EmptyDirVolume ¶
type EmptyDirVolume struct { Medium StorageMedium `json:"medium,omitempty"` SizeLimit BytesSize `json:"sizeLimit,omitempty"` }
type EnvVar ¶
type EnvVar struct { // Name of the environment variable. Name string `json:"name" yaml:"name"` // Description only used to describe the env Description string `json:"description,omitempty" yaml:"description,omitempty"` // Variable references $(VAR_NAME) are expanded // using the previously defined environment variables in the container and // any service environment variables. If a variable cannot be resolved, // the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. // "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". // Escaped references will never be expanded, regardless of whether the variable exists or not. // Defaults to "". Value string `json:"value,omitempty" yaml:"value,omitempty"` // Source for the environment variable's value. Cannot be used if the value is not empty. ValueFrom *EnvVarSource `json:"valueFrom,omitempty" yaml:"valueFrom,omitempty"` }
EnvVar represents an environment variable present in a Flow.
type EnvVarSource ¶
type EnvVarSource struct {
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
}
EnvVarSource represents a source for the value of an EnvVar.
type Flow ¶
type Flow struct { Name string `json:"name" yaml:"name"` Image string `json:"image,omitempty" yaml:"image,omitempty"` ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"` Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` WorkingDir string `json:"workingDir,omitempty" yaml:"workingDir,omitempty"` Env []EnvVar `json:"env,omitempty" yaml:"env,omitempty"` Entrypoint []string `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"` Shell []string `json:"shell,omitempty" yaml:"shell,omitempty"` Command []string `json:"command,omitempty" yaml:"command,omitempty"` Args []string `json:"args,omitempty" yaml:"args,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" yaml:"volumeMounts,omitempty"` Devices []VolumeDevice `json:"devices,omitempty" yaml:"devices,omitempty"` DNS []string `json:"dns,omitempty" yaml:"dns,omitempty"` DNSSearch []string `json:"dnsSearch,omitempty" yaml:"dnsSearch,omitempty"` ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extraHosts,omitempty"` }
type HostPathVolume ¶
type HostPathVolume struct {
Path string `json:"path"`
}
type ListOption ¶
type ListOption struct { Pagination Pagination LabelSelector string }
func (*ListOption) Labels ¶
func (o *ListOption) Labels() map[string]string
func (*ListOption) SetLabels ¶
func (o *ListOption) SetLabels(labels map[string]string)
func (*ListOption) ToValues ¶
func (o *ListOption) ToValues() url.Values
type Metadata ¶
type Metadata struct { Kind string `json:"kind" yaml:"kind"` Name string `json:"name" yaml:"name"` Namespace string `json:"namespace" yaml:"namespace"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` ID uint64 `json:"id,omitempty" yaml:"id,omitempty"` Creation time.Time `json:"creation,omitempty" yaml:"creation,omitempty"` Deletion *time.Time `json:"deletion,omitempty" yaml:"deletion,omitempty"` }
func GetMetadata ¶
func NewMetadata ¶
func (*Metadata) GetCreationTimestamp ¶
func (*Metadata) GetDeletionTimestamp ¶
func (*Metadata) GetNamespace ¶
func (*Metadata) SetCreationTimestamp ¶
func (*Metadata) SetDeletionTimestamp ¶
func (*Metadata) SetNamespace ¶
type Object ¶
type Object interface { GetNamespace() string SetNamespace(namespace string) GetKind() string SetKind(kind string) GetName() string SetName(name string) GetLabels() map[string]string SetLabels(labels map[string]string) GetCreationTimestamp() time.Time SetCreationTimestamp(timestamp time.Time) GetDeletionTimestamp() *time.Time SetDeletionTimestamp(timestamp *time.Time) }
type Pagination ¶
type Pagination struct { Page int `json:"page" desc:"page number"` Size int `json:"size" desc:"page size"` Total int64 `json:"total" desc:"total number"` }
func GetPagination ¶
func GetPagination(r *http.Request) *Pagination
func (*Pagination) SetTotal ¶
func (o *Pagination) SetTotal(total int64) *Pagination
func (*Pagination) ToValues ¶
func (o *Pagination) ToValues() url.Values
type Phase ¶
type Phase string
const ( PhaseUnknown Phase = "Unknown" // PhaseWaiting used for dependencies, // the status description that waits for the dependency to finish executing. PhaseWaiting Phase = "Waiting" PhasePending Phase = "Pending" PhaseRunning Phase = "Running" PhaseSucceeded Phase = "Succeeded" PhaseFailed Phase = "Failed" PhaseCanceled Phase = "Canceled" PhaseSkipped Phase = "Skipped" )
func (Phase) IsSucceeded ¶
type Platform ¶
type Platform struct { OS string `json:"os,omitempty" yaml:"os,omitempty"` Arch string `json:"arch,omitempty" yaml:"arch,omitempty"` }
Platform defines the target platform.
type PullPolicy ¶
type PullPolicy string
const ( // PullAlways means that kubelet always attempts to pull the latest image. // Flow will fail If the pull fails. PullAlways PullPolicy = "Always" // PullNever means that kubelet never pulls an image, but only uses a local image. // Flow will fail if the image isn't present. PullNever PullPolicy = "Never" // PullIfNotPresent means that kubelet pulls if the image isn't present on disk. // Flow will fail if the image isn't present and the pull fails. PullIfNotPresent PullPolicy = "IfNotPresent" )
func (PullPolicy) String ¶
func (s PullPolicy) String() string
type Secret ¶
type SecretKeySelector ¶
type SecretKeySelector struct { // The name of the secret in the same namespace to select from. Name string `json:"name" yaml:"name"` // The key of the secret to select from. Must be a valid secret key. Key string `json:"key" yaml:"key"` }
SecretKeySelector selects a key of a Secret.
type Stage ¶
type Stage struct { ID uint64 `json:"id" yaml:"id"` BoxID uint64 `json:"boxID" yaml:"boxID"` BuildID uint64 `json:"buildID" yaml:"buildID"` Number uint64 `json:"number" yaml:"number"` Phase Phase `json:"phase" yaml:"phase"` Name string `json:"name" yaml:"name"` Limit int `json:"limit" yaml:"limit"` Started int64 `json:"started,omitempty" yaml:"started,omitempty"` Stopped int64 `json:"stopped,omitempty" yaml:"stopped,omitempty"` Error string `json:"error,omitempty" yaml:"error,omitempty"` WorkerName string `json:"workerName,omitempty" yaml:"workerName,omitempty"` Worker Worker `json:"worker,omitempty" yaml:"worker,omitempty"` DependsOn []string `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"` Steps []*Step `json:"steps,omitempty" yaml:"steps,omitempty"` }
type Step ¶
type Step struct { ID uint64 `json:"id" yaml:"id"` StageID uint64 `json:"stageID" yaml:"stageID"` Number uint64 `json:"number" yaml:"number"` Phase Phase `json:"phase" yaml:"phase"` Name string `json:"name" yaml:"name"` Started int64 `json:"started,omitempty" yaml:"started,omitempty"` Stopped int64 `json:"stopped,omitempty" yaml:"stopped,omitempty"` ExitCode int `json:"exitCode,omitempty" yaml:"exitCode,omitempty"` Error string `json:"error,omitempty" yaml:"error,omitempty"` }
type StorageMedium ¶
type StorageMedium string
StorageMedium defines ways that storage can be allocated to a volume.
const ( StorageMediumDefault StorageMedium = "" // use whatever the default is for the node, assume anything we don't explicitly handle is this StorageMediumMemory StorageMedium = "memory" // use memory (e.g. tmpfs on linux) )
type UnstructuredObject ¶
func (*UnstructuredObject) GetCreationTimestamp ¶
func (o *UnstructuredObject) GetCreationTimestamp() time.Time
func (*UnstructuredObject) GetDeletionTimestamp ¶
func (o *UnstructuredObject) GetDeletionTimestamp() *time.Time
func (*UnstructuredObject) GetKind ¶
func (o *UnstructuredObject) GetKind() string
func (*UnstructuredObject) GetLabels ¶
func (o *UnstructuredObject) GetLabels() map[string]string
func (*UnstructuredObject) GetName ¶
func (o *UnstructuredObject) GetName() string
func (*UnstructuredObject) GetNamespace ¶
func (o *UnstructuredObject) GetNamespace() string
func (*UnstructuredObject) MarshalJSON ¶
func (o *UnstructuredObject) MarshalJSON() ([]byte, error)
func (*UnstructuredObject) MarshalYAML ¶
func (o *UnstructuredObject) MarshalYAML() ([]byte, error)
func (*UnstructuredObject) SetCreationTimestamp ¶
func (o *UnstructuredObject) SetCreationTimestamp(timestamp time.Time)
func (*UnstructuredObject) SetDeletionTimestamp ¶
func (o *UnstructuredObject) SetDeletionTimestamp(timestamp *time.Time)
func (*UnstructuredObject) SetKind ¶
func (o *UnstructuredObject) SetKind(kind string)
func (*UnstructuredObject) SetLabels ¶
func (o *UnstructuredObject) SetLabels(labels map[string]string)
func (*UnstructuredObject) SetName ¶
func (o *UnstructuredObject) SetName(name string)
func (*UnstructuredObject) SetNamespace ¶
func (o *UnstructuredObject) SetNamespace(namespace string)
func (*UnstructuredObject) ToObject ¶
func (o *UnstructuredObject) ToObject(v Object) error
func (*UnstructuredObject) UnmarshalJSON ¶
func (o *UnstructuredObject) UnmarshalJSON(data []byte) error
func (*UnstructuredObject) UnmarshalYAML ¶
func (o *UnstructuredObject) UnmarshalYAML(value *yaml.Node) error
type Volume ¶
type Volume struct { Name string `json:"name"` HostPath *HostPathVolume `json:"hostPath,omitempty" ` EmptyDir *EmptyDirVolume `json:"emptyDir,omitempty" ` }
type VolumeDevice ¶
type VolumeMount ¶
type VolumeMount struct { // This must match the Name of a Volume. Name string `json:"name"` // Path within the container at which the volume should be mounted. Must // not contain ':'. Path string `json:"path"` }
VolumeMount describes a mounting of a Volume within a container.
type Worker ¶
type Worker struct { Kind WorkerKind `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` Platform *Platform `json:"platform,omitempty" yaml:"platform,omitempty"` }
type WorkerKind ¶
type WorkerKind string
const ( WorkerKindHost WorkerKind = "host" WorkerKindDocker WorkerKind = "docker" WorkerKindKubernetes WorkerKind = "kubernetes" WorkerKindSSH WorkerKind = "ssh" )
func (WorkerKind) String ¶
func (s WorkerKind) String() string
type Workflow ¶
type Workflow struct { Metadata `yaml:",inline"` Spec WorkflowSpec `json:"spec" yaml:"spec"` }
type WorkflowSpec ¶
type WorkflowSpec struct { Steps []Flow `json:"steps" yaml:"steps"` WorkingDir string `json:"workingDir,omitempty" yaml:"workingDir,omitempty"` Concurrency int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"` Volumes []Volume `json:"volumes,omitempty" yaml:"volumes,omitempty"` DependsOn []string `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"` ImagePullSecrets []string `json:"imagePullSecrets,omitempty" yaml:"imagePullSecrets,omitempty"` Worker *Worker `json:"worker,omitempty" yaml:"worker,omitempty"` When *selector.Selector `json:"when,omitempty" yaml:"when,omitempty"` }
Click to show internal directories.
Click to hide internal directories.