jobhdl

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateJobResponse added in v0.8.0

func NewCreateJobResponse(j *domain.Job) (*pb.CreateJobResponse, error)

func NewGetJobResponse added in v0.8.0

func NewGetJobResponse(j *domain.Job) (*pb.GetJobResponse, error)

Types

type JobHTTPHandler

type JobHTTPHandler struct {
	handler.HTTPHandler
	// contains filtered or unexported fields
}

JobHTTPHandler is an HTTP handler that exposes job endpoints.

func NewJobHTTPHandler

func NewJobHTTPHandler(jobService port.JobService, jobQueue port.JobQueue) *JobHTTPHandler

NewJobHTTPHandler creates and returns a new JobHTTPHandler.

func (*JobHTTPHandler) Create

func (hdl *JobHTTPHandler) Create(c *gin.Context)

Create creates a new job.

func (*JobHTTPHandler) Delete

func (hdl *JobHTTPHandler) Delete(c *gin.Context)

Delete deletes a job.

func (*JobHTTPHandler) Get

func (hdl *JobHTTPHandler) Get(c *gin.Context)

Get fetches a job.

func (*JobHTTPHandler) GetJobs

func (hdl *JobHTTPHandler) GetJobs(c *gin.Context)

GetJobs fetches all jobs, optionally filters them by status.

func (*JobHTTPHandler) Update

func (hdl *JobHTTPHandler) Update(c *gin.Context)

Update updates a job.

type JobgRPCHandler

type JobgRPCHandler struct {
	pb.UnimplementedJobServer
	// contains filtered or unexported fields
}

JobgRPCHandler is a gRPC handler that exposes job endpoints.

func NewJobgRPCHandler

func NewJobgRPCHandler(jobService port.JobService) *JobgRPCHandler

NewJobgRPCHandler creates and returns a new JobgRPCHandler.

func (*JobgRPCHandler) Create

// Create creates a new job.

func (*JobgRPCHandler) Delete

Delete deletes a job.

func (*JobgRPCHandler) Get

func (*JobgRPCHandler) GetJobs

GetJobs fetches all jobs, optionally filters them by status.

func (*JobgRPCHandler) Update

Update updates a job.

type RequestBodyDTO

type RequestBodyDTO struct {
	Name               string                 `json:"name"`
	Description        string                 `json:"description"`
	TaskName           string                 `json:"task_name"`
	Timeout            int                    `json:"timeout"`
	TaskParams         map[string]interface{} `json:"task_params"`
	RunAt              string                 `json:"run_at"`
	UsePreviousResults bool                   `json:"use_previous_results"`
}

RequestBodyDTO is the data transfer object used for a job creation or update.

func NewRequestBodyDTO

func NewRequestBodyDTO() *RequestBodyDTO

NewRequestBodyDTO initializes and returns a new BodyDTO instance.

type ResponseBodyDTO

type ResponseBodyDTO *domain.Job

ResponseBodyDTO is the response data transfer object used for a job creation or update.

func BuildResponseBodyDTO

func BuildResponseBodyDTO(resource *domain.Job) ResponseBodyDTO

BuildResponseDTO creates a new ResponseDTO.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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