browser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package browser provides browser opening functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultBrowser

type DefaultBrowser struct{}

DefaultBrowser opens URLs in the system default browser.

func NewDefaultBrowser

func NewDefaultBrowser() *DefaultBrowser

NewDefaultBrowser creates a new DefaultBrowser.

func (*DefaultBrowser) Open

func (b *DefaultBrowser) Open(url string) error

Open opens a URL in the default browser. On Linux, it ensures the browser is started in its own process group so that Ctrl+C doesn't kill the browser when stopping the CLI.

type MockBrowser

type MockBrowser struct {
	OpenCalled bool
	LastURL    string
	OpenFunc   func(url string) error
}

MockBrowser is a mock implementation for testing.

func NewMockBrowser

func NewMockBrowser() *MockBrowser

NewMockBrowser creates a new MockBrowser.

func (*MockBrowser) Open

func (m *MockBrowser) Open(url string) error

Open records the call and optionally calls the custom function.

Jump to

Keyboard shortcuts

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