client

package
v0.0.0-...-3a757e4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SubmitJob(*models.JobData) (string, error)
	GetJobLog(uuid string) ([]byte, error)
	PostAction(uuid, action string) error
}

Client wraps interface to access jobservice.

type DefaultClient

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

DefaultClient is the default implementation of Client interface

func NewDefaultClient

func NewDefaultClient(endpoint, secret string) *DefaultClient

NewDefaultClient creates a default client based on endpoint and secret.

func (*DefaultClient) GetJobLog

func (d *DefaultClient) GetJobLog(uuid string) ([]byte, error)

GetJobLog call jobserivce API to get the log of a job. It only accepts the UUID of the job

func (*DefaultClient) PostAction

func (d *DefaultClient) PostAction(uuid, action string) error

PostAction call jobservice's API to operate action for job specified by uuid

func (*DefaultClient) SubmitJob

func (d *DefaultClient) SubmitJob(jd *models.JobData) (string, error)

SubmitJob call jobserivce API to submit a job and returns the job's UUID.

Jump to

Keyboard shortcuts

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