pathway

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: MIT Imports: 5 Imported by: 0

README

pathway

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastWriter

func BroadcastWriter(writers ...io.Writer) io.WriteCloser

BroadcastWriter creates a writer that duplicates its writes to all the provided writers, similar to the Unix tee(1) command.

Each write is written to each listed writer, one at a time. If a listed writer returns an error, that overall write operation continues and the offending writer is dropped from the list.

Only if all writers are dropped, the last error is returned at the end.

Types

type Pathway added in v0.1.2

type Pathway struct {
	sync.Map
}

Pathway keeps track of and allows one to handle all the different paths.

func New added in v0.1.2

func New() *Pathway

New returns a usable Pathway which HTTP Handler can be used to allow clients to create and connect to eachother via arbitraty paths.

func (*Pathway) ServeHTTP added in v0.1.2

func (pw *Pathway) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is a handler for incoming GET or POST request. It directs them to the proper path: either by creating a new one or connecting it to an existing one.

Jump to

Keyboard shortcuts

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