Documentation
¶
Overview ¶
Package logs provides real-time log streaming functionality.
Index ¶
Constants ¶
const (
// DefaultMaxLines is the default maximum number of log lines to keep.
DefaultMaxLines = 5000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker manages log subscriptions and publishing.
func (*Broker) PublishBatch ¶
PublishBatch sends multiple log entries to all matching subscribers.
func (*Broker) Subscribe ¶
func (b *Broker) Subscribe(ctx context.Context, appID, deploymentID, source string) *Subscriber
Subscribe creates a new subscription for log events. Returns a subscriber that can be used to receive logs.
func (*Broker) SubscriberCount ¶
SubscriberCount returns the number of active subscribers.
func (*Broker) Unsubscribe ¶
func (b *Broker) Unsubscribe(sub *Subscriber)
Unsubscribe removes a subscription.
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container maintains a bounded collection of log entries. It automatically removes the oldest entries when the limit is exceeded.
func NewContainer ¶
NewContainer creates a new log container with the specified max lines.
func (*Container) Add ¶
Add adds a log entry to the container. If the container is at capacity, the oldest entry is removed.