wtf

package module
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 15 Imported by: 34

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