browsh

package
v0.0.0-...-da00ea3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StartupURL = flag.String("startup-url", "https://google.com", "URL to launch at startup")

	// IsHTTPServer needs to be exported for use in tests
	IsHTTPServer = flag.Bool("http-server", false, "Run as an HTTP service")
	// HTTPServerPort also needs to be exported for use in tests
	HTTPServerPort = flag.String("http-server-port", "4333", "HTTP server address")
	// IsTesting is used in tests, so it needs to be exported
	IsTesting = false
)
View Source
var CurrentTab *tab

CurrentTab is the currently active tab in the TTY browser

View Source
var (

	// IsMonochromeMode decides whether to render the TTY in full colour or monochrome
	IsMonochromeMode = false
)
View Source
var Tabs = make(map[int]*tab)

Tabs is a map of all tab data

Functions

func HTTPServerStart

func HTTPServerStart()

HTTPServerStart starts the HTTP server is a seperate service from the usual interactive TTY app. It accepts normal HTTP requests and uses the path portion of the URL as the entry to the Browsh URL bar. It then returns a simple line-broken text version of whatever the browser loads. So for example, if you request `curl browsh-http-service.com/http://something.com`, it will return: `Something `

func Log

func Log(msg string)

Log for general purpose logging TODO: accept generic types

func MainEntry

func MainEntry()

MainEntry decides between running Browsh as a CLI app or as an HTTP web server

func Shell

func Shell(command string) string

Shell provides nice and easy shell commands

func Shutdown

func Shutdown(err error)

Shutdown tries its best to cleanly shutdown browsh and the associated browser

func TTYStart

func TTYStart(injectedScreen tcell.Screen)

TTYStart starts Browsh

Types

This section is empty.

Jump to

Keyboard shortcuts

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