agent

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package agent provides context management for the Alpamon agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextManager

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

ContextManager manages contexts for the agent, providing centralized context creation and cancellation.

func NewContextManager

func NewContextManager() *ContextManager

NewContextManager creates a new context manager with a root context.

func (*ContextManager) IsShutdown

func (m *ContextManager) IsShutdown() bool

IsShutdown returns true if the context manager has been shut down.

func (*ContextManager) NewContext

func (m *ContextManager) NewContext(timeout time.Duration) (context.Context, context.CancelFunc)

NewContext creates a new child context with an optional timeout. If timeout is 0 or negative, no timeout is applied.

func (*ContextManager) NewContextWithDeadline

func (m *ContextManager) NewContextWithDeadline(deadline time.Time) (context.Context, context.CancelFunc)

NewContextWithDeadline creates a new child context with a specific deadline.

func (*ContextManager) Root

func (m *ContextManager) Root() context.Context

Root returns the root context. This should be used sparingly, primarily for operations that need to outlive the normal shutdown process.

func (*ContextManager) Shutdown

func (m *ContextManager) Shutdown()

Shutdown cancels the root context, triggering cancellation of all child contexts. This should be called during graceful shutdown.

Jump to

Keyboard shortcuts

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