model

package
v0.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const NewWindowVersion = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type JobSpec

type JobSpec struct {
	Version      int                 `yaml:"version,omitempty"`
	Name         string              `yaml:"name"`
	Owner        string              `yaml:"owner"`
	Description  string              `yaml:"description,omitempty"`
	Schedule     JobSpecSchedule     `yaml:"schedule"`
	Behavior     JobSpecBehavior     `yaml:"behavior"`
	Task         JobSpecTask         `yaml:"task"`
	Asset        map[string]string   `yaml:"-"`
	Labels       map[string]string   `yaml:"labels,omitempty"`
	Hooks        []JobSpecHook       `yaml:"hooks"`
	Dependencies []JobSpecDependency `yaml:"dependencies"`
	Metadata     *JobSpecMetadata    `yaml:"metadata,omitempty"`
	Path         string              `yaml:"-"`
}

func ToJobSpec

func ToJobSpec(protoSpec *pb.JobSpecification) *JobSpec

func (*JobSpec) MergeFrom

func (j *JobSpec) MergeFrom(anotherJobSpec *JobSpec)

TODO: there are some refactors required, however it will be addressed once we relook at the job spec inheritance

func (*JobSpec) ToProto

func (j *JobSpec) ToProto() *pb.JobSpecification

type JobSpecBehavior

type JobSpecBehavior struct {
	DependsOnPast bool                      `yaml:"depends_on_past"`
	Catchup       bool                      `yaml:"catch_up,omitempty"`
	Retry         *JobSpecBehaviorRetry     `yaml:"retry,omitempty"`
	Notify        []JobSpecBehaviorNotifier `yaml:"notify,omitempty"`
	Webhook       []JobSpecBehaviorWebhook  `yaml:"webhook,omitempty"`
}

type JobSpecBehaviorNotifier

type JobSpecBehaviorNotifier struct {
	On       string            `yaml:"on"`
	Config   map[string]string `yaml:"config"`
	Channels []string          `yaml:"channels"`
}

type JobSpecBehaviorRetry

type JobSpecBehaviorRetry struct {
	Count              int           `yaml:"count,omitempty"`
	Delay              time.Duration `yaml:"delay,omitempty"`
	ExponentialBackoff bool          `yaml:"exponential_backoff,omitempty"`
}

type JobSpecBehaviorWebhook added in v0.11.4

type JobSpecBehaviorWebhook struct {
	On        string            `yaml:"on"`
	Endpoints []WebhookEndpoint `yaml:"endpoints"`
}

type JobSpecDependency

type JobSpecDependency struct {
	JobName string                 `yaml:"job,omitempty"`
	Type    string                 `yaml:"type,omitempty"`
	HTTP    *JobSpecDependencyHTTP `yaml:"http,omitempty"`
}

type JobSpecDependencyHTTP

type JobSpecDependencyHTTP struct {
	Name          string            `yaml:"name"`
	RequestParams map[string]string `yaml:"params,omitempty"`
	URL           string            `yaml:"url"`
	Headers       map[string]string `yaml:"headers,omitempty"`
}

type JobSpecHook

type JobSpecHook struct {
	Name   string            `yaml:"name"`
	Config map[string]string `yaml:"config,omitempty"`
}

type JobSpecMetadata

type JobSpecMetadata struct {
	Resource *JobSpecMetadataResource `yaml:"resource,omitempty"`
	Airflow  *JobSpecMetadataAirflow  `yaml:"airflow,omitempty"`
}

type JobSpecMetadataAirflow

type JobSpecMetadataAirflow struct {
	Pool  string `yaml:"pool" json:"pool"`
	Queue string `yaml:"queue" json:"queue"`
}

type JobSpecMetadataResource

type JobSpecMetadataResource struct {
	Request *JobSpecMetadataResourceConfig `yaml:"request,omitempty"`
	Limit   *JobSpecMetadataResourceConfig `yaml:"limit,omitempty"`
}

type JobSpecMetadataResourceConfig

type JobSpecMetadataResourceConfig struct {
	Memory string `yaml:"memory,omitempty"`
	CPU    string `yaml:"cpu,omitempty"`
}

type JobSpecSchedule

type JobSpecSchedule struct {
	StartDate string `yaml:"start_date"`
	EndDate   string `yaml:"end_date,omitempty"`
	Interval  string `yaml:"interval"`
}

type JobSpecTask

type JobSpecTask struct {
	Name   string            `yaml:"name"`
	Config map[string]string `yaml:"config,omitempty"`
	Window JobSpecTaskWindow `yaml:"window,omitempty"`
}

type JobSpecTaskWindow

type JobSpecTaskWindow struct {
	Size string `yaml:"size,omitempty"`
	// deprecated, replaced by ShiftBy
	Offset     string `yaml:"offset,omitempty"`
	TruncateTo string `yaml:"truncate_to,omitempty"`
	Preset     string `yaml:"preset,omitempty"`
	ShiftBy    string `yaml:"shift_by,omitempty"`
	Location   string `yaml:"location,omitempty"`
}

type Preset added in v0.10.0

type Preset struct {
	Description string            `yaml:"description"`
	Window      JobSpecTaskWindow `yaml:"window"`
}

type PresetsMap added in v0.10.0

type PresetsMap struct {
	Presets map[string]Preset `yaml:"presets"`
}

type ResourceSpec

type ResourceSpec struct {
	Version int                    `yaml:"version"`
	Name    string                 `yaml:"name"`
	Type    string                 `yaml:"type"`
	Labels  map[string]string      `yaml:"labels"`
	Spec    map[string]interface{} `yaml:"spec"`
	Path    string                 `yaml:"-"`
}

func (ResourceSpec) ToProto

func (r ResourceSpec) ToProto() (*pb.ResourceSpecification, error)

type WebhookEndpoint added in v0.11.4

type WebhookEndpoint struct {
	URL     string            `yaml:"url"`
	Headers map[string]string `yaml:"headers,omitempty"`
}

Jump to

Keyboard shortcuts

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