logs

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: AGPL-3.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BatchFlushInterval = 50 * time.Millisecond
	BatchMaxSize       = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterV1 added in v0.2.0

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

AdapterV1 wraps SDK v1 logs.Provider as the engine canonical Provider. For v1, all methods are direct delegation (types identical). When v2 ships and canonical types diverge, AdapterV1 translates v1 → canonical.

func NewAdapterV1 added in v0.2.0

func NewAdapterV1(inner logs.Provider) *AdapterV1

NewAdapterV1 creates a new v1 adapter wrapping the given SDK logs provider.

func (*AdapterV1) CloseSession added in v0.2.0

func (a *AdapterV1) CloseSession(ctx *types.PluginContext, sessionID string) error

func (*AdapterV1) CreateSession added in v0.2.0

func (a *AdapterV1) CreateSession(ctx *types.PluginContext, opts logs.CreateSessionOptions) (*logs.LogSession, error)

func (*AdapterV1) GetSession added in v0.2.0

func (a *AdapterV1) GetSession(ctx *types.PluginContext, sessionID string) (*logs.LogSession, error)

func (*AdapterV1) GetSupportedResources added in v0.2.0

func (a *AdapterV1) GetSupportedResources(ctx *types.PluginContext) []logs.Handler

func (*AdapterV1) ListSessions added in v0.2.0

func (a *AdapterV1) ListSessions(ctx *types.PluginContext) ([]*logs.LogSession, error)

func (*AdapterV1) Stream added in v0.2.0

func (a *AdapterV1) Stream(ctx context.Context, in chan logs.StreamInput) (chan logs.StreamOutput, error)

func (*AdapterV1) UpdateSessionOptions added in v0.2.0

func (a *AdapterV1) UpdateSessionOptions(
	ctx *types.PluginContext,
	sessionID string,
	opts logs.LogSessionOptions,
) (*logs.LogSession, error)

type Controller

type Controller interface {
	internaltypes.Controller
	ServiceStartup(ctx context.Context, options application.ServiceOptions) error
	ServiceShutdown() error
	GetSupportedResources(pluginID string) []logs.Handler
	CreateSession(plugin, connectionID string, opts logs.CreateSessionOptions) (*logs.LogSession, error)
	GetSession(sessionID string) (*logs.LogSession, error)
	ListSessions() ([]*logs.LogSession, error)
	CloseSession(sessionID string) error
	SendCommand(sessionID string, cmd logs.LogStreamCommand) error
	UpdateSessionOptions(sessionID string, opts logs.LogSessionOptions) (*logs.LogSession, error)
}

Controller manages log sessions across all plugins.

func NewController

func NewController(
	logger logging.Logger,
	sp pkgsettings.Provider,
	resourceClient resource.Service,
) Controller

type Provider added in v0.4.0

type Provider interface {
	GetSupportedResources(ctx *types.PluginContext) []logs.Handler
	CreateSession(ctx *types.PluginContext, opts logs.CreateSessionOptions) (*logs.LogSession, error)
	GetSession(ctx *types.PluginContext, sessionID string) (*logs.LogSession, error)
	ListSessions(ctx *types.PluginContext) ([]*logs.LogSession, error)
	CloseSession(ctx *types.PluginContext, sessionID string) error
	UpdateSessionOptions(ctx *types.PluginContext, sessionID string, opts logs.LogSessionOptions) (*logs.LogSession, error)
	Stream(ctx context.Context, in chan logs.StreamInput) (chan logs.StreamOutput, error)
}

Provider is the engine's version-independent interface for log plugins. For v1, method signatures match SDK logs.Provider exactly (doc 20 §13.7). When v2 redesigns logs (context.Context, interfaces), this diverges.

type ServiceWrapper added in v0.4.0

type ServiceWrapper struct {
	Ctrl Controller
}

ServiceWrapper is an explicit delegation wrapper around logs.Controller. Excluded: OnPluginInit, OnPluginStart, OnPluginStop, OnPluginShutdown,

OnPluginDestroy

func (*ServiceWrapper) CloseSession added in v0.4.0

func (s *ServiceWrapper) CloseSession(sessionID string) error

func (*ServiceWrapper) CreateSession added in v0.4.0

func (s *ServiceWrapper) CreateSession(
	plugin, connectionID string,
	opts logssdk.CreateSessionOptions,
) (*logssdk.LogSession, error)

func (*ServiceWrapper) GetSession added in v0.4.0

func (s *ServiceWrapper) GetSession(sessionID string) (*logssdk.LogSession, error)

func (*ServiceWrapper) GetSupportedResources added in v0.4.0

func (s *ServiceWrapper) GetSupportedResources(pluginID string) []logssdk.Handler

func (*ServiceWrapper) HasPlugin added in v0.4.0

func (s *ServiceWrapper) HasPlugin(pluginID string) bool

func (*ServiceWrapper) ListPlugins added in v0.4.0

func (s *ServiceWrapper) ListPlugins() ([]string, error)

func (*ServiceWrapper) ListSessions added in v0.4.0

func (s *ServiceWrapper) ListSessions() ([]*logssdk.LogSession, error)

func (*ServiceWrapper) SendCommand added in v0.4.0

func (s *ServiceWrapper) SendCommand(sessionID string, cmd logssdk.LogStreamCommand) error

func (*ServiceWrapper) ServiceShutdown added in v0.4.0

func (s *ServiceWrapper) ServiceShutdown() error

func (*ServiceWrapper) ServiceStartup added in v0.4.0

func (s *ServiceWrapper) ServiceStartup(ctx context.Context, options application.ServiceOptions) error

func (*ServiceWrapper) UpdateSessionOptions added in v0.4.0

func (s *ServiceWrapper) UpdateSessionOptions(
	sessionID string,
	opts logssdk.LogSessionOptions,
) (*logssdk.LogSession, error)

Jump to

Keyboard shortcuts

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