package logbroker

import "github.com/moby/swarmkit/v2/manager/logbroker"

Index

Types

type LogBroker

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

LogBroker coordinates log subscriptions to services and tasks. Clients can publish and subscribe to logs channels.

Log subscriptions are pushed to the work nodes by creating log subscription tasks. As such, the LogBroker also acts as an orchestrator of these tasks.

func New

func New(store *store.MemoryStore) *LogBroker

New initializes and returns a new LogBroker

func (*LogBroker) ListenSubscriptions

func (lb *LogBroker) ListenSubscriptions(request *api.ListenSubscriptionsRequest, stream api.LogBroker_ListenSubscriptionsServer) error

ListenSubscriptions returns a stream of matching subscriptions for the current node

func (*LogBroker) PublishLogs

func (lb *LogBroker) PublishLogs(stream api.LogBroker_PublishLogsServer) (err error)

PublishLogs publishes log messages for a given subscription

func (*LogBroker) Start

func (lb *LogBroker) Start(ctx context.Context) error

Start starts the log broker

func (*LogBroker) Stop

func (lb *LogBroker) Stop() error

Stop stops the log broker

func (*LogBroker) SubscribeLogs

func (lb *LogBroker) SubscribeLogs(request *api.SubscribeLogsRequest, stream api.Logs_SubscribeLogsServer) error

SubscribeLogs creates a log subscription and streams back logs

Source Files

broker.go subscription.go

Version
v2.0.0-20250103191802-8c1959736554 (latest)
Published
Jan 3, 2025
Platform
linux/amd64
Imports
16 packages
Last checked
1 week ago

Tools for package owners.