net

package
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package net provides net functionality for grpc

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultResolver is an alias of net.DefaultResolver
	DefaultResolver = net.DefaultResolver
)

Functions

func IsIPv4

func IsIPv4(addr string) bool

IsIPv4 returns weather the address is IPv4 address.

func IsIPv6

func IsIPv6(addr string) bool

IsIPv6 returns weather the address is IPv6 address.

func IsLocal

func IsLocal(host string) bool

IsLocal returns if the host is the localhost address.

func Parse

func Parse(addr string) (host string, port uint16, isIP bool, err error)

Parse parses the hostname, IPv4 or IPv6 address and return the hostname/IP, port number, whether the address is IP, and any parsing error occurred. The address should contains the port number, otherwise an error will return.

func ScanPorts

func ScanPorts(ctx context.Context, start, end uint16, host string) (ports []uint16, err error)

ScanPorts scans the given range of port numbers from the host (inclusively), and return the list of ports that can be connected through TCP, or any error occurred.

func SplitHostPort

func SplitHostPort(hostport string) (host string, port uint16, err error)

SplitHostPort splits the address, and return the host/IP address and the port number, and any error occurred. If it is the loopback address, it will return the loopback address and corresponding port number. IPv6 loopback address is not supported yet. For more information, please read https://github.com/vdaas/vald/projects/3#card-43504189

Types

type Conn

type Conn = net.Conn

Conn is an alias of net.Conn

func Dial added in v0.0.29

func Dial(network, addr string) (conn Conn, err error)

Dial is a wrapper function of the net.Dial function.

type Dialer

type Dialer = net.Dialer

Dialer is an alias of net.Dialer

type ListenConfig

type ListenConfig = net.ListenConfig

ListenConfig is an alias of net.ListenConfig

type Listener

type Listener = net.Listener

Listener is an alias of net.Listener

func Listen

func Listen(network, address string) (Listener, error)

Listen is a wrapper function of the net.Listen function.

type Resolver

type Resolver = net.Resolver

Resolver is an alias of net.Resolver

Directories

Path Synopsis
Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc
Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc Package grpc provides generic functionality for grpc
metric
Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc
Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc Package metric provides metrics functions for grpc
pool
Package pool provides grpc connection pool client Package pool provides grpc connection pool client
Package pool provides grpc connection pool client Package pool provides grpc connection pool client
proto
Package proto provides proto file logic
Package proto provides proto file logic
status
Package status provides statuses and errors returned by grpc handler functions
Package status provides statuses and errors returned by grpc handler functions
http
dump
Package dump provides http request/response dump logic
Package dump provides http request/response dump logic
metrics
Package metrics provides pprof profiler handler
Package metrics provides pprof profiler handler
middleware
Package middleware provides rest.Func Middleware Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package middleware provides rest.Func Middleware
Package middleware provides rest.Func Middleware Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package middleware provides rest.Func Middleware
rest
Package rest provides REST API common logic & variable
Package rest provides REST API common logic & variable
routing
Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func
Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func Package routing provides implementation of Go API for routing http Handler wrapped by rest.Func
transport
Package transport provides http transport roundtrip option Package transport provides http transport roundtrip option
Package transport provides http transport roundtrip option Package transport provides http transport roundtrip option
Package tcp provides tcp option Package tcp provides tcp option Package tcp provides tcp option
Package tcp provides tcp option Package tcp provides tcp option Package tcp provides tcp option

Jump to

Keyboard shortcuts

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