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

infrastructure

package
v0.239.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircularScreenshotBuffer

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

CircularScreenshotBuffer implements a thread-safe ring buffer for screenshots with optional disk persistence

func NewCircularScreenshotBuffer

func NewCircularScreenshotBuffer(maxSize int, tempDir string, sessionID string) (*CircularScreenshotBuffer, error)

NewCircularScreenshotBuffer creates a new circular buffer for screenshots

func (*CircularScreenshotBuffer) Add

func (b *CircularScreenshotBuffer) Add(screenshot *agentdomain.Frame) error

Add adds a new screenshot to the buffer If the buffer is full, it evicts the oldest screenshot

func (*CircularScreenshotBuffer) Cleanup

func (b *CircularScreenshotBuffer) Cleanup() error

Cleanup removes the temp directory and all screenshots

func (*CircularScreenshotBuffer) Count

func (b *CircularScreenshotBuffer) Count() int

Count returns the current number of screenshots in the buffer

func (*CircularScreenshotBuffer) GetLatest

func (b *CircularScreenshotBuffer) GetLatest() (*agentdomain.Frame, error)

GetLatest returns the most recent screenshot

func (*CircularScreenshotBuffer) GetRecent

func (b *CircularScreenshotBuffer) GetRecent(limit int) []*agentdomain.Frame

GetRecent returns the N most recent screenshots

type ScreenshotServer

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

ScreenshotServer provides an HTTP API for screenshot streaming

func NewScreenshotServer

func NewScreenshotServer(cfg *config.Config, imageService agentdomain.ImageService, sessionID string) *ScreenshotServer

NewScreenshotServer creates a new screenshot server

func (*ScreenshotServer) GetLatestFrame

func (s *ScreenshotServer) GetLatestFrame() (*agentdomain.Frame, error)

GetLatestFrame retrieves the latest screenshot from the buffer

func (*ScreenshotServer) Port

func (s *ScreenshotServer) Port() int

Port returns the port the server is listening on

func (*ScreenshotServer) Start

func (s *ScreenshotServer) Start() error

Start starts the HTTP server and background capture loop

func (*ScreenshotServer) Stop

func (s *ScreenshotServer) Stop() error

Stop stops the HTTP server and capture loop. It releases the lock before Shutdown, which waits for in-flight handlers that take the read lock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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