jobkickqd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaemonConfig

type DaemonConfig struct {
	ProjectID     string
	JobQueueTopic string
	LogTopic      string
	App           string
	WorkDir       string
}

DaemonConfig is ...

type DefaultJobMessage

type DefaultJobMessage struct {
	JobID          string   `json:"jobID"`
	JobExecutionID string   `json:"jobExecutionID"`
	Command        string   `json:"command"`
	Environment    []string `json:"environment"`
	Timeout        int      `json:"timeout"`
}

DefaultJobMessage is ...

type Job

type Job struct {
	JobID          string
	JobExecutionID string
	CommandString  string
	Environment    []string
	JobExitCode    int
	ExecutionLog   string
	SentAt         time.Time
	SubmittedAt    time.Time
	StartedAt      time.Time
	FinishedAt     time.Time
	Timeout        time.Duration
	Cmd            exec.Cmd
}

Job is...

func NewJob

func NewJob(jobID, jobExecutionID, CommandString string, environment []string, timeout time.Duration) *Job

NewJob is...

func (*Job) Execute

func (j *Job) Execute(ctx context.Context) error

Execute is...

func (*Job) Kill

func (j *Job) Kill(ctx context.Context) error

Kill is...

type JobQueueExecutor

type JobQueueExecutor interface {
	Run()
}

JobQueueExecutor is...

type MessageDriver

type MessageDriver interface {
	Write()
}

MessageDriver is ...

type PubSubJobQueue

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

PubSubJobQueue is...

func NewPubSubJobQueueExecutor

func NewPubSubJobQueueExecutor(ctx context.Context, projectID, topicName, subscriptionName, daemonApp string) (*PubSubJobQueue, error)

NewPubSubJobQueueExecutor is...

func (*PubSubJobQueue) Run

func (jq *PubSubJobQueue) Run(ctx, cctx context.Context, ld PubSubMessageDriver) error

Run is...

type PubSubMessageDriver

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

PubSubMessageDriver is ...

func NewPubSubMessageDriver

func NewPubSubMessageDriver(ctx context.Context, projectID, topicName string) (*PubSubMessageDriver, error)

NewPubSubMessageDriver is ...

func (*PubSubMessageDriver) Write

func (ld *PubSubMessageDriver) Write(ctx context.Context, message string, attributes map[string]string) (string, error)

Jump to

Keyboard shortcuts

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