job

package
v0.0.0-...-1a65ef4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(config JobConfiguration, file string) error

Types

type Job

type Job struct {
	Id     string           `json:"id"`
	Name   string           `json:"name"`
	Status JobStatus        `json:"status"`
	Config JobConfiguration `json:"config"`
	Stats  *Stats           `json:"stats,omitempty"`
	// contains filtered or unexported fields
}

func CreateJob

func CreateJob(name string, source source.Source, sinks []sink.Sink, obs []observer.Observer, timeout int, config JobConfiguration) *Job

func NewJob

func NewJob(config JobConfiguration) (*Job, error)

func NewJobFromFile

func NewJobFromFile(file string) (*Job, error)

func (*Job) ID

func (j *Job) ID() string

func (*Job) Start

func (j *Job) Start()

func (*Job) Stop

func (j *Job) Stop()

func (*Job) Wait

func (j *Job) Wait()

type JobConfiguration

type JobConfiguration struct {
	Name      string                   `json:"name"`
	Source    source.Configuration     `json:"source,omitempty"`
	Sinks     []sink.Configuration     `json:"sinks,omitempty"`
	Observers []observer.Configuration `json:"observer,omitempty"`
	Timeout   int                      `json:"timeout,omitempty"`
}

func LoadConfig

func LoadConfig(file string) (*JobConfiguration, error)

type JobManager

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

func NewJobManager

func NewJobManager() *JobManager

func (*JobManager) CreateJob

func (m *JobManager) CreateJob(config JobConfiguration) (*Job, error)

func (*JobManager) CreateJobFromFile

func (m *JobManager) CreateJobFromFile(file string) (*Job, error)

func (*JobManager) DeleteJob

func (m *JobManager) DeleteJob(id string) error

func (*JobManager) GetJob

func (m *JobManager) GetJob(id string) (*Job, error)

func (*JobManager) ListJob

func (m *JobManager) ListJob() []*Job

func (*JobManager) StartJob

func (m *JobManager) StartJob(id string) error

func (*JobManager) StopJob

func (m *JobManager) StopJob(id string) error

func (*JobManager) WaitJob

func (m *JobManager) WaitJob(id string) error

type JobStatus

type JobStatus string
const (
	STATUS_INIT    JobStatus = "init"
	STATUS_RUNNING JobStatus = "running"
	STATUS_STOPPED JobStatus = "stopped"
	STATUS_FAILED  JobStatus = "failed"
)

type Stats

type Stats struct {
	SuccessWrite int `json:"success_write"`
	FailedWrite  int `json:"failed_write"`
}

Jump to

Keyboard shortcuts

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