server

package module
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPMiddleware added in v1.5.0

type HTTPMiddleware interface {
	// Return a http handler with middleware as the parent handler
	HandleFunc(http.HandlerFunc) http.HandlerFunc
}

type HTTPRouter added in v1.5.0

type HTTPRouter interface {
	// Return the CORS origin
	Origin() string

	// Register a function to handle a URL path
	HandleFunc(context.Context, string, http.HandlerFunc)
}

type Logger

type Logger interface {

	// Emit an informational message
	Print(context.Context, ...any)
}

type PG added in v1.5.5

type PG interface {
	// Return the connection pool
	Conn() pg.PoolConn
}

type PGCallback added in v1.5.5

type PGCallback func(context.Context, any) error

type PGQueue added in v1.5.5

type PGQueue interface {
	Task

	// Return the worker name
	Worker() string

	// Register a ticker with a callback, and return the registered ticker
	RegisterTicker(context.Context, schema.TickerMeta, PGCallback) (*schema.Ticker, error)

	// Register a queue with a callback, and return the registered queue
	RegisterQueue(context.Context, schema.Queue, PGCallback) (*schema.Queue, error)

	// Create a task for a queue with a payload and optional delay, and return it
	CreateTask(context.Context, string, any, time.Duration) (*schema.Task, error)

	// Delete a ticker by name
	DeleteTicker(context.Context, string) error
}

type Plugin

type Plugin interface {
	// Return the unique name for the plugin
	Name() string

	// Return a description of the plugin
	Description() string

	// Create a task from a plugin
	New(context.Context) (Task, error)
}

Plugin represents a service

type Provider

type Provider interface {
	Task

	// Return a task given a plugin label
	Task(context.Context, string) Task
}

Provider represents a service provider

type Task added in v1.0.48

type Task interface {
	// Run a task
	Run(context.Context) error
}

Task represents a service task

Directories

Path Synopsis
cmd
server command
pkg
plugin
pg

Jump to

Keyboard shortcuts

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