netutil

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 2 Imported by: 0

README

Net Utils

  • provide some network utils. eg: InternalIPv4
  • sub package:
    • httpctypes - provide some commonly http content types.
    • httpheader - provide some commonly http header names.
    • httpreq - provide some http request utils

Install

go get github.com/gookit/goutil/netutil

Go docs

Usage

import "github.com/gookit/goutil/netutil"
// Get internal IPv4 address
netutil.InternalIPv4()

Testings

go test -v ./netutil/...

Test limit by regexp:

go test -v -run ^TestSetByKeys ./netutil/...

Documentation

Overview

Package netutil provide some network util functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalIPs added in v0.6.10

func GetLocalIPs() (ips []string)

GetLocalIPs get local IPs

func InternalIP

func InternalIP() (ip string)

InternalIP get internal IP

func InternalIPv1 added in v0.6.11

func InternalIPv1() (ip string)

InternalIPv1 get internal IP buy old logic

func InternalIPv4 added in v0.5.0

func InternalIPv4() (ip string)

InternalIPv4 get internal IPv4

func InternalIPv6 added in v0.5.0

func InternalIPv6() (ip string)

InternalIPv6 get internal IPv6

Types

This section is empty.

Directories

Path Synopsis
Package httpctype list some common http content-type
Package httpctype list some common http content-type
Package httpheader provides some common http header names.
Package httpheader provides some common http header names.
Package httpreq provide an simple http requester and some useful util functions.
Package httpreq provide an simple http requester and some useful util functions.

Jump to

Keyboard shortcuts

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