Help us shape the future of Go! Take the 2026 Go Developer Survey

scope

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Scope)

Option configures a Scope.

func WithPort

func WithPort(port int) Option

WithPort sets the port for the internal gRPC server.

type Scope

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

Scope manages the lifecycle of the event broker and internal gRPC server that exposes captured query events to TUI clients.

func New

func New(ctx context.Context, opts ...Option) (*Scope, error)

New creates a new Scope and starts the internal gRPC server.

func (*Scope) Close

func (s *Scope) Close()

Close stops the internal gRPC server.

func (*Scope) Err

func (s *Scope) Err() <-chan error

Err returns a channel that receives the server's exit error. It is nil if the server is still running.

func (*Scope) GenerateID

func (s *Scope) GenerateID() string

GenerateID returns a unique sequential ID for a query event.

func (*Scope) Publish

func (s *Scope) Publish(ev event.Query)

Publish sends a query event to all connected subscribers.

func (*Scope) Subscribe

func (s *Scope) Subscribe() (<-chan event.Query, func())

Subscribe returns a channel that receives published events and an unsubscribe function.

func (*Scope) SubscriberCount

func (s *Scope) SubscriberCount() int

SubscriberCount returns the number of active Watch subscribers.

Directories

Path Synopsis
gen
internal

Jump to

Keyboard shortcuts

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