job

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	On       string
	Config   map[string]string
	Channels []string
}

type Asset

type Asset struct {
	Name  string
	Value string
}

type Config

type Config struct {
	Configs map[string]string
}

type Downstream

type Downstream struct {
	JobName       string `json:"job_name"`
	ProjectName   string `json:"project_name"`
	NamespaceName string `json:"namespace_name"`
	TaskName      string `json:"task_name"`
}

type Hook

type Hook struct {
	Name   string
	Config map[string]string
}

type JobRepository

type JobRepository struct {
	// contains filtered or unexported fields
}

func NewJobRepository

func NewJobRepository(pool *pgxpool.Pool) *JobRepository

func (JobRepository) Add

func (j JobRepository) Add(ctx context.Context, jobs []*job.Job) ([]*job.Job, error)

func (JobRepository) ChangeJobNamespace

func (j JobRepository) ChangeJobNamespace(ctx context.Context, jobName job.Name, tenant, newTenant tenant.Tenant) error

func (JobRepository) Delete

func (j JobRepository) Delete(ctx context.Context, projectName tenant.ProjectName, jobName job.Name, cleanHistory bool) error

func (JobRepository) GetAllByProjectName

func (j JobRepository) GetAllByProjectName(ctx context.Context, projectName tenant.ProjectName) ([]*job.Job, error)

func (JobRepository) GetAllByResourceDestination

func (j JobRepository) GetAllByResourceDestination(ctx context.Context, resourceDestination job.ResourceURN) ([]*job.Job, error)

func (JobRepository) GetAllByTenant

func (j JobRepository) GetAllByTenant(ctx context.Context, jobTenant tenant.Tenant) ([]*job.Job, error)

func (JobRepository) GetByJobName

func (j JobRepository) GetByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) (*job.Job, error)

func (JobRepository) GetDownstreamByDestination

func (j JobRepository) GetDownstreamByDestination(ctx context.Context, projectName tenant.ProjectName, destination job.ResourceURN) ([]*job.Downstream, error)

func (JobRepository) GetDownstreamByJobName

func (j JobRepository) GetDownstreamByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Downstream, error)

func (JobRepository) GetDownstreamBySources

func (j JobRepository) GetDownstreamBySources(ctx context.Context, sources []job.ResourceURN) ([]*job.Downstream, error)

func (JobRepository) GetUpstreams

func (j JobRepository) GetUpstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Upstream, error)

func (JobRepository) ReplaceUpstreams

func (j JobRepository) ReplaceUpstreams(ctx context.Context, jobsWithUpstreams []*job.WithUpstream) error

func (JobRepository) ResolveUpstreams

func (j JobRepository) ResolveUpstreams(ctx context.Context, projectName tenant.ProjectName, jobNames []job.Name) (map[job.Name][]*job.Upstream, error)

func (JobRepository) SyncState

func (j JobRepository) SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error

func (JobRepository) Update

func (j JobRepository) Update(ctx context.Context, jobs []*job.Job) ([]*job.Job, error)

func (JobRepository) UpdateState

func (j JobRepository) UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error

type JobWithUpstream

type JobWithUpstream struct {
	JobName               string         `json:"job_name"`
	ProjectName           string         `json:"project_name"`
	UpstreamJobName       sql.NullString `json:"upstream_job_name"`
	UpstreamResourceURN   sql.NullString `json:"upstream_resource_urn"`
	UpstreamProjectName   sql.NullString `json:"upstream_project_name"`
	UpstreamNamespaceName sql.NullString `json:"upstream_namespace_name"`
	UpstreamTaskName      sql.NullString `json:"upstream_task_name"`
	UpstreamHost          sql.NullString `json:"upstream_host"`
	UpstreamType          string         `json:"upstream_type"`
	UpstreamState         string         `json:"upstream_state"`
	UpstreamExternal      sql.NullBool   `json:"upstream_external"`
}

func UpstreamFromRow

func UpstreamFromRow(row pgx.Row) (*JobWithUpstream, error)

type Metadata

type Metadata struct {
	Resource  *MetadataResource
	Scheduler map[string]string
}

type MetadataResource

type MetadataResource struct {
	Request *MetadataResourceConfig
	Limit   *MetadataResourceConfig
}

type MetadataResourceConfig

type MetadataResourceConfig struct {
	CPU    string
	Memory string
}

type ProjectAndJobNames

type ProjectAndJobNames struct {
	ProjectName string `json:"project_name"`
	JobName     string `json:"job_name"`
}

type Retry

type Retry struct {
	Count              int
	Delay              int32
	ExponentialBackoff bool
}

type Schedule

type Schedule struct {
	StartDate     time.Time
	EndDate       *time.Time `json:",omitempty"`
	Interval      string
	DependsOnPast bool
	Retry         *Retry
}

type Spec

type Spec struct {
	ID          uuid.UUID
	Name        string
	Version     int
	Owner       string
	Description string
	Labels      map[string]string

	Schedule   json.RawMessage
	WindowSpec json.RawMessage

	Alert json.RawMessage

	StaticUpstreams pq.StringArray
	HTTPUpstreams   json.RawMessage

	TaskName   string
	TaskConfig map[string]string

	Hooks json.RawMessage

	Assets map[string]string

	Metadata json.RawMessage

	Destination string
	Sources     pq.StringArray

	ProjectName   string `json:"project_name"`
	NamespaceName string `json:"namespace_name"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime
}

func FromRow

func FromRow(row pgx.Row) (*Spec, error)

type Window

type Window struct {
	WindowSize       string
	WindowOffset     string
	WindowTruncateTo string
}

Jump to

Keyboard shortcuts

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