metahook

package
v0.0.0-...-d018c20 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaHook

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

MetaHook is a component to update the MetaConfig over a controlled uds http api.

func NewMetaHook

func NewMetaHook() *MetaHook

Creates a new metahook instance.

func (*MetaHook) Launch

func (m *MetaHook) Launch(
	logger *logger.Logger,
	metaConfig *metaconfig.MetaConfig,
	socketPath string,
	socketPerm fs.FileMode,
	retryMaxSeconds int) error

Launch starts the metahook server on the specified socket.

This operation prepares the socket and starts a separate goroutine to run the server. The server worker restarts automatically on failure with an exponential backoff retry. After a successful launch or shutdown, further calls to Launch will result in an error.

logger: The logger instance used to log operations performed. metaConfig: A pointer to the metaconfig object controlled by this hook. socketPath: The filesystem path for the Unix domain socket. socketPerm: The permissions for the socket file. retryMaxSeconds: The maximum number of seconds until a retry is performed on error. Returns an error if there is a failure in preparing the socket.

func (*MetaHook) Shutdown

func (m *MetaHook) Shutdown() error

Shutdown stops the metahook server and blocks until it is done.

Shutdown closes the http server and waits until it is fully stopped. The function is idempotent, meaning further calls to Shutdown will not result in an error.

Returns an error if there is a critical failure while shutting down the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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