netutil

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const IPPattern = `` /* 158-byte string literal not displayed */

Variables

This section is empty.

Functions

func GetHostIp added in v1.1.1

func GetHostIp() (string, error)

func GetIPV4

func GetIPV4(addr net.Addr) string

func IP2BigInt

func IP2BigInt(IP net.IP) *big.Int

func LocalIP

func LocalIP() (net.IP, error)

func LocalIPV4

func LocalIPV4() string

func SetupGracefulStop

func SetupGracefulStop(srv *http.Server)

func Shutdown

func Shutdown(srv *http.Server)

Types

type JSONResponse

type JSONResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data,omitempty"`
}

JSONResponse

func BindJSONResponse

func BindJSONResponse(data []byte) *JSONResponse

func NewJSONResponse

func NewJSONResponse(data any) *JSONResponse

JSONResponse

func (*JSONResponse) Error

func (e *JSONResponse) Error() error

Jump to

Keyboard shortcuts

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