server

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse is a standard JSON error envelope.

type Server

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

Server is the HTTP API for the sidecar.

func NewServer

func NewServer(addr string, eng *engine.Engine) *Server

NewServer creates a Server wired to the given engine.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

ListenAndServe starts the HTTP server and blocks until ctx is cancelled.

type TaskRequest

type TaskRequest struct {
	Type     string           `json:"type"`
	Params   map[string]any   `json:"params,omitempty"`
	Schedule *engine.Schedule `json:"schedule,omitempty"`
}

TaskRequest is the JSON body for POST /v0/tasks. If Schedule is set the task becomes a recurring cron-triggered task; otherwise it runs immediately.

Jump to

Keyboard shortcuts

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