server

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon interface {
	Name() string // For logging/identification
	Start() error
	Stop(ctx context.Context) error
}

Daemon defines the contract for background components managed by the server's lifecycle (Start/Stop).

type Server

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

func NewServer

func NewServer(provider *config.Provider, handler http.Handler, logger *slog.Logger, reloadFunc func() error) *Server

NewServer constructor - daemons are added via AddDaemon.

func (*Server) AddDaemon

func (s *Server) AddDaemon(daemon Daemon)

AddDaemon adds a daemon whose lifecycle will be managed by the server.

func (*Server) AddJobHandler

func (s *Server) AddJobHandler(jobType string, handler executor.JobHandler) error

AddJobHandler registers a custom job handler for the scheduler daemon. It finds the scheduler daemon by name and delegates registration to it. Returns an error if the scheduler daemon is not found, is not the expected type, or if registration within the scheduler fails. This method should be called after New() and before Run().

func (*Server) Run

func (s *Server) Run()

Jump to

Keyboard shortcuts

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