preview

package
v0.0.0-...-1d32ed5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChunkBytes       = 196608
	DefaultMaxFrameBytes    = 1048576
	DefaultMaxActiveStreams = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	Registry *Registry
	Sender   Sender
	Client   *http.Client
}

func (*HTTPHandler) Handle

type OpenRequest

type OpenRequest struct {
	PreviewID string
	SessionID string
	ChannelID string
	MachineID string
	Target    Target
	ExpiresAt time.Time
}

type Preview

type Preview struct {
	OpenRequest
	// contains filtered or unexported fields
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) CancelStream

func (r *Registry) CancelStream(streamID string)

func (*Registry) Close

func (r *Registry) Close(previewID string)

func (*Registry) Get

func (r *Registry) Get(previewID string) (Preview, bool)

func (*Registry) Open

func (r *Registry) Open(_ context.Context, req OpenRequest) error

func (*Registry) RegisterStream

func (r *Registry) RegisterStream(previewID, streamID string) (context.Context, context.CancelFunc, bool)

func (*Registry) UnregisterStream

func (r *Registry) UnregisterStream(previewID, streamID string)

type Sender

type Sender interface {
	Send(ctx context.Context, msg any) error
}

type Target

type Target struct {
	Host string
	Port int
}

func NormalizeTarget

func NormalizeTarget(host string, port int) (Target, error)

func (Target) Addr

func (t Target) Addr() string

func (Target) Addrs

func (t Target) Addrs() []string

type WebSocketBridge

type WebSocketBridge struct {
	Registry *Registry
	Sender   Sender
	// contains filtered or unexported fields
}

func NewWebSocketBridge

func NewWebSocketBridge(registry *Registry, sender Sender) *WebSocketBridge

func (*WebSocketBridge) Close

func (*WebSocketBridge) Data

func (*WebSocketBridge) Open

Jump to

Keyboard shortcuts

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