api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package api provides methods for creating API-related HTTP handlers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobStatusHandler

func JobStatusHandler(opts *JobStatusHandlerOptions) http.Handler

JobStatusHandler() returns an `http.Handler` instance that will return a JSON-encoded `JobStatusResponse` for a job identified by a HTTP GET "id" query parameter.

func ScheduleJobHandler added in v0.0.15

func ScheduleJobHandler(opts *ScheduleJobHandlerOptions) http.Handler

ScheduleJobHandler() returns an `http.Handler` instance that...

Types

type JobStatusHandlerOptions

type JobStatusHandlerOptions struct {
	// A `sfomuseum/go-offline.Database` instance to query for jobs.
	OfflineDatabase offline.Database
	// A `sfomuseum/go-http-auth.Authenticator` instance to use to restrict access.
	Authenticator auth.Authenticator
}

type JobStatusHandlerOptions defines a struct containing configuration options for the `JobStatusHandler` method.

type ScheduleJobHandlerOptions added in v0.0.15

type ScheduleJobHandlerOptions struct {
	// A `sfomuseum/go-offline.Database` instance to query for jobs.
	OfflineDatabase offline.Database
	// A `sfomuseum/go-offline.Queue` instance to schedule jobs.
	// OfflineQueue offline.Queue
	// A `sfomuseum/go-http-auth.Authenticator` instance to use to restrict access.
	OfflineQueueMux map[string]offline.Queue
	Authenticator   auth.Authenticator
}

type ScheduleJobHandlerOptions defines a struct containing configuration options for the `ScheduleJobHandler` method.

Jump to

Keyboard shortcuts

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