netutils

package module
v0.0.0-...-a882ff2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2015 License: MIT Imports: 10 Imported by: 0

README

go-netutils

Go net utils.

GoDoc

Install

go get github.com/koofr/go-netutils

Testing

go get -t
go test

Documentation

Overview

Inspiration: https://gist.github.com/idada/9144886

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Await

func Await(addr string, step time.Duration, totalTime time.Duration) (ok bool)

func GenerateCert

func GenerateCert(organization string, host string, validFor time.Duration, rsaBits int) (certBytes []byte, keyBytes []byte, err error)

func UnusedPort

func UnusedPort() (port int, err error)

Types

type TimeoutConn

type TimeoutConn struct {
	// contains filtered or unexported fields
}

func NewTimeoutConn

func NewTimeoutConn(conn net.Conn, readTimeout time.Duration, writeTimeout time.Duration) *TimeoutConn

func (*TimeoutConn) Close

func (c *TimeoutConn) Close() error

func (*TimeoutConn) LocalAddr

func (c *TimeoutConn) LocalAddr() net.Addr

func (*TimeoutConn) Read

func (c *TimeoutConn) Read(b []byte) (n int, err error)

func (*TimeoutConn) RemoteAddr

func (c *TimeoutConn) RemoteAddr() net.Addr

func (*TimeoutConn) SetDeadline

func (c *TimeoutConn) SetDeadline(t time.Time) error

func (*TimeoutConn) SetReadDeadline

func (c *TimeoutConn) SetReadDeadline(t time.Time) error

func (*TimeoutConn) SetWriteDeadline

func (c *TimeoutConn) SetWriteDeadline(t time.Time) error

func (*TimeoutConn) Write

func (c *TimeoutConn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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