net

package
v0.0.0-...-1d97044 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostPort

func HostPort(addr string, port interface{}) string

func Listen

func Listen(addr string, fn func(string) (net.Listener, *errorAVA.Error)) (net.Listener, *errorAVA.Error)

Types

type NET

type NET struct {
}

func GetInstance

func GetInstance() *NET

func (*NET) HostPort

func (n *NET) HostPort(addr string, port interface{}) string

HostPort format addr and port suitable for dial

func (*NET) Listen

func (n *NET) Listen(addr string, fn func(string) (net.Listener, *errorAVA.Error)) (net.Listener, *errorAVA.Error)

Listen takes addr:portmin-portmax and binds to the first available port Example: Listen("localhost:5000-6000", fn)

type NETI

type NETI interface {
	HostPort(addr string, port interface{}) string
	Listen(addr string, fn func(string) (net.Listener, *errorAVA.Error)) (net.Listener, *errorAVA.Error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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