Documentation ¶
Index ¶
- func NewCreateJobResponse(j *domain.Job) (*pb.CreateJobResponse, error)
- func NewGetJobResponse(j *domain.Job) (*pb.GetJobResponse, error)
- type JobHTTPHandler
- type JobgRPCHandler
- func (hdl *JobgRPCHandler) Create(ctx context.Context, in *pb.CreateJobRequest) (*pb.CreateJobResponse, error)
- func (hdl *JobgRPCHandler) Delete(ctx context.Context, in *pb.DeleteJobRequest) (*pb.DeleteJobResponse, error)
- func (hdl *JobgRPCHandler) Get(ctx context.Context, in *pb.GetJobRequest) (*pb.GetJobResponse, error)
- func (hdl *JobgRPCHandler) GetJobs(ctx context.Context, in *pb.GetJobsRequest) (*pb.GetJobsResponse, error)
- func (hdl *JobgRPCHandler) Update(ctx context.Context, in *pb.UpdateJobRequest) (*pb.UpdateJobResponse, error)
- type RequestBodyDTO
- type ResponseBodyDTO
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) 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 ¶
func (hdl *JobgRPCHandler) Create(ctx context.Context, in *pb.CreateJobRequest) (*pb.CreateJobResponse, error)
// Create creates a new job.
func (*JobgRPCHandler) Delete ¶
func (hdl *JobgRPCHandler) Delete(ctx context.Context, in *pb.DeleteJobRequest) (*pb.DeleteJobResponse, error)
Delete deletes a job.
func (*JobgRPCHandler) Get ¶
func (hdl *JobgRPCHandler) Get(ctx context.Context, in *pb.GetJobRequest) (*pb.GetJobResponse, error)
func (*JobgRPCHandler) GetJobs ¶
func (hdl *JobgRPCHandler) GetJobs(ctx context.Context, in *pb.GetJobsRequest) (*pb.GetJobsResponse, error)
GetJobs fetches all jobs, optionally filters them by status.
func (*JobgRPCHandler) Update ¶
func (hdl *JobgRPCHandler) Update(ctx context.Context, in *pb.UpdateJobRequest) (*pb.UpdateJobResponse, error)
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 ¶
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.