bcatlib

package
v0.0.0-...-02e100b Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render()

func ServerEndpoint

func ServerEndpoint(source <-chan []byte) (<-chan bool, string)

ServerEndpoint is a channel sink and returns the URL of the server as well as a completion channel.

func TeeFilter

func TeeFilter(source <-chan []byte, outfile *os.File) <-chan []byte

TeeFilter applies a basic tee filter on unaltered contents of a string chan.

func TextFilter

func TextFilter(source <-chan []byte) <-chan []byte

TextFilter applies a basic filter on the contents of a string chan, escaping HTML, and newline characters

Types

type Bcat

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

type Browser

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

A Browser holds the environment to manipulate various browsers.

func NewBrowser

func NewBrowser(browser, command string) (*Browser, error)

New creates a new browser environment

func (*Browser) Open

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

Open opens a browser window pointing to url

type FilterFunc

type FilterFunc func(<-chan []byte) <-chan []byte

FilterFunc applies some filter on a channel of byte slices.

type Options

type Options struct {
	Host    string
	Port    int64
	Html    bool
	Title   string
	Browser string
	Ansi    bool
	Persist bool
	Command bool
	Debug   bool
	Tee     bool
}

type ReaderCollection

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

ReaderCollection implements io.ReaderCloser on a collection of files

func NewReaderCollection

func NewReaderCollection(args []string) (*ReaderCollection, error)

NewReaderCollection creates a new ReaderCollection with file descriptors in the same nature as cat.

func (*ReaderCollection) Close

func (r *ReaderCollection) Close() error

Close closes up each of the files and returns the error of the one that failed last.

func (*ReaderCollection) MakeFilterableChan

func (r *ReaderCollection) MakeFilterableChan() <-chan []byte

MakeFilterableChan returns a byte slice channel appropriate for use in a FilterFunc.

func (*ReaderCollection) Read

func (r *ReaderCollection) Read(p []byte) (int, error)

type Server

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

Server allows content to be served on a random unused port.

func NewServer

func NewServer(h http.HandlerFunc) (*Server, error)

NewServer creates a new server instance and mounts a single http.HandleFunc to "/". NewServer does not use the net/http singleton ServeMux.

func (*Server) Serve

func (s *Server) Serve() error

Serve accepts incoming connections and responds to them in their own goroutine.

func (*Server) Url

func (s *Server) Url() string

Returns the URL that the server is listening on.

Jump to

Keyboard shortcuts

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