httptypes

package
v0.0.0-...-7ed8402 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package httptypes contains types that are serialized in HTTP request bodies or responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateJobTypeRequest

type CreateJobTypeRequest struct {
	Name        string `json:"name"`
	Attempts    int16  `json:"attempts"`
	Concurrency int16  `json:"concurrency"`
	// Should match the values in the newmodels.DeliveryStrategy enum
	// - "at_most_once" or "at_least_once"
	DeliveryStrategy string `json:"delivery_strategy"`
}

CreateJobTypeRequest contains data sent in the body of a request to create a job type.

type EnqueueJobRequest

type EnqueueJobRequest struct {
	// Job data to enqueue.
	Data json.RawMessage `json:"data"`
	// The earliest time we can run this job. If not specified, defaults to the
	// current time.
	RunAfter types.NullTime `json:"run_after"`
	// The latest time we can run this job. If not specified, defaults to null
	// (never expires).
	ExpiresAt types.NullTime `json:"expires_at"`
}

An EnqueueJobRequest is sent in the body of a request to PUT /v1/jobs/:job-name/:job-id.

type Job

type Job struct {
	Name             string    `json:"name"`
	DeliveryStrategy string    `json:"delivery_strategy"`
	Attempts         int16     `json:"attempts"`
	Concurrency      int16     `json:"concurrency"`
	CreatedAt        time.Time `json:"created_at"`
}

type JobStatusRequest

type JobStatusRequest struct {
	// Should match one of the values in newmodels.ArchivedJobStatus
	// ("succeeded" or "failed").
	Status string `json:"status"`

	// Attempt is sent to ensure we don't attempt a null write.
	Attempt *int16 `json:"attempt"` // pointer to distinguish between null/omitted value and 0.

	// Retryable indicates whether a failure is retryable. The default is true.
	// Set to false to avoid retrying a particular failure.
	Retryable *bool `json:"retryable"` // pointer to distinguish between null value and false.
}

The body of a POST request to /v1/jobs/:job-name/:job-id, recording the status of a job.

Jump to

Keyboard shortcuts

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