wtf

package module
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 15 Imported by: 11 modules, 34 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

WTF

go.dev reference License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGcInterval = 0 * time.Second

DefaultGcInterval is the default garbage collection interval for the WTF client.

View Source
var DefaultGcRetry int64 = 3

DefaultGcRetry is the default garbage collection retry limit.

View Source
var DefaultTimeout = 10 * time.Second

DefaultTimeout is the default dialing timeout for the WTF client.

View Source
var Turbofish = []string{
	">             ",
	"<>            ",
	":<>           ",
	" ::<>         ",
	"  ::<>        ",
	"   ::<>       ",
	"    ::<>      ",
	"     ::<>     ",
	"      ::<>    ",
	"       ::<>   ",
	"        ::<>  ",
	"         ::<> ",
	"          ::<>",
	"           ::<",
	"            ::",
	"             :",
	"             <",
	"            <>",
	"           <>:",
	"          <>::",
	"         <>:: ",
	"        <>::  ",
	"       <>::   ",
	"      <>::    ",
	"     <>::     ",
	"    <>::      ",
	"   <>::       ",
	"  <>::        ",
	" <>::         ",
	"<>::          ",
	">::           ",
	"::            ",
	":             ",
}

Functions

func Serve

func Serve(relay string, handler http.Handler) error

Serve starts a WTF server on the given relay URL. GC: Automatically close the server when health check fails for the given times - gc: health check interval interval (0 for disable) - retry: Retry the health check for the given times - timeout: Automatically close the client when dial timeouts - quiet: Do not log the status of the server (false for loggy) - persist: Automatically restart the server when it becomes unresponsive (0 for disable)

func ServeWithConfig

func ServeWithConfig(config *ServerConfig) error

Serve starts a WTF server on the given relay URL.

Types

type ServerConfig

type ServerConfig struct {
	StationURL *url.URL
	Handler    http.Handler
	Timeout    time.Duration
	GcInterval time.Duration
	GcRetry    int64
	Quiet      bool
}

ServerConfig is the configuration for the WTF server.

Jump to

Keyboard shortcuts

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