socketlistener

package
v0.0.0-...-0a271de Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package socketlistener provides a worker that will listen on a specified unix socket identified by a file descriptor. Handlers are provided to the worker that specify endpoints and define the action to be taken when they are reached.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger logger.Logger
	// SocketName is the socket file descriptor.
	SocketName string
	// RegisterHandlers should register handlers on the router with
	// router.HandlerFunc or similar.
	RegisterHandlers func(router *mux.Router)
	// ShutdownTimeout is how long the socketlistener has to gracefully shutdown
	// when Kill is called on the worker.
	ShutdownTimeout time.Duration
}

Config represents configuration for the socketlistener worker.

func (Config) Validate

func (config Config) Validate() error

Validate returns an error if config cannot drive the SocketListener.

type SocketListener

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

SocketListener is a socketlistener worker.

func NewSocketListener

func NewSocketListener(config Config) (*SocketListener, error)

NewSocketListener returns a socketlistener with the given config.

func (*SocketListener) Kill

func (sl *SocketListener) Kill()

Kill is part of the Worker.worker interface.

func (*SocketListener) Wait

func (sl *SocketListener) Wait() error

Wait is part of the Worker.worker interface.

Jump to

Keyboard shortcuts

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