Documentation ¶
Index ¶
- func GetHostAndIP(bindStr string, portStr string) (host string, port int)
- func GetLocalHostByIPType(ipType string) ([]string, error)
- func GetURLToOpen(host string, port int) (primary string, extra []string)
- func HandleJSON(w http.ResponseWriter, r *http.Request, ...)
- func IsTCPAddrServing(url string, timeout time.Duration) (bool, error)
- func ParamErrorf(format string, args ...interface{}) error
- func PrintUrls(url string, extra ...string)
- func ServePort(host string, port int, autoIncrPort bool, watchTimeout time.Duration, ...) error
- func ServePortHTTP(server *http.ServeMux, host string, port int, autoIncrPort bool, ...) error
- func SetCORSHeaders(w http.ResponseWriter)
- type HttpStatusErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostAndIP ¶ added in v1.0.40
provide default values for host and port
func GetLocalHostByIPType ¶ added in v1.0.40
get the local area network IP address by ipType
func GetURLToOpen ¶ added in v1.0.41
get URL based on host and port
func HandleJSON ¶ added in v1.0.37
func ParamErrorf ¶ added in v1.0.37
func ServePort ¶
func ServePort(host string, port int, autoIncrPort bool, watchTimeout time.Duration, watch func(port int), doWithPort func(port int) error) error
suggested watch timeout: 500ms
func ServePortHTTP ¶ added in v1.0.37
func SetCORSHeaders ¶ added in v1.0.37
func SetCORSHeaders(w http.ResponseWriter)
allow request from arbitrary host
Types ¶
type HttpStatusErr ¶ added in v1.0.37
Click to show internal directories.
Click to hide internal directories.