logs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

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 LogsProvider. 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 Client

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

func NewClient

func NewClient(controller Controller) *Client

func (*Client) CloseSession

func (c *Client) CloseSession(sessionID string) error

func (*Client) CreateSession

func (c *Client) CreateSession(
	plugin, connectionID string,
	opts sdklogs.CreateSessionOptions,
) (*sdklogs.LogSession, error)

func (*Client) GetSession

func (c *Client) GetSession(sessionID string) (*sdklogs.LogSession, error)

func (*Client) GetSupportedResources

func (c *Client) GetSupportedResources(pluginID string) []sdklogs.Handler

func (*Client) ListSessions

func (c *Client) ListSessions() ([]*sdklogs.LogSession, error)

func (*Client) PauseSession

func (c *Client) PauseSession(sessionID string) error

func (*Client) ResumeSession

func (c *Client) ResumeSession(sessionID string) error

func (*Client) UpdateSessionOptions

func (c *Client) UpdateSessionOptions(
	sessionID string,
	opts sdklogs.LogSessionOptions,
) (*sdklogs.LogSession, error)

type Controller

type Controller interface {
	internaltypes.Controller
	Run(ctx context.Context)
	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 LogsProvider added in v0.2.0

type LogsProvider 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)
}

LogsProvider 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.

Jump to

Keyboard shortcuts

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