common

package
v0.0.0-...-c071561 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = 1024
	MiB = KiB * 1024
	GiB = MiB * 1024
)

Variables

This section is empty.

Functions

func HumanFriendlyTraffic

func HumanFriendlyTraffic(bytes uint64) string

func Must

func Must(err error)

func Must2

func Must2(_ interface{}, err error)

func PickPort

func PickPort(network string, host string) int

Types

type Error

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

func NewError

func NewError(info string) *Error

func (*Error) Base

func (e *Error) Base(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type RewindConn

type RewindConn struct {
	net.Conn
	*RewindReader
}

func NewRewindConn

func NewRewindConn(conn net.Conn) *RewindConn

func (*RewindConn) Read

func (c *RewindConn) Read(p []byte) (int, error)

type RewindReader

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

func (*RewindReader) Discard

func (r *RewindReader) Discard(n int) (int, error)

func (*RewindReader) Read

func (r *RewindReader) Read(p []byte) (int, error)

func (*RewindReader) ReadByte

func (r *RewindReader) ReadByte() (byte, error)

func (*RewindReader) Rewind

func (r *RewindReader) Rewind()

func (*RewindReader) SetBufferSize

func (r *RewindReader) SetBufferSize(size int)

func (*RewindReader) StopBuffering

func (r *RewindReader) StopBuffering()

type StickyWriter

type StickyWriter struct {
	MaxBuffered int
	// contains filtered or unexported fields
}

func (*StickyWriter) Write

func (w *StickyWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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