util

package
v0.0.0-...-c6e4f4a Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(ctx context.Context, src, dst string) (int64, error)

func GetInterfaceIPv4

func GetInterfaceIPv4(iface *net.Interface) string

func GetLoopbackInterface

func GetLoopbackInterface() (*net.Interface, error)

Types

type BufferPool

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

func NewBufferPool

func NewBufferPool() *BufferPool

func (*BufferPool) Get

func (p *BufferPool) Get() interface{}

func (*BufferPool) GetBuffer

func (p *BufferPool) GetBuffer() *bytes.Buffer

func (*BufferPool) Put

func (p *BufferPool) Put(buf interface{})

func (*BufferPool) PutBuffer

func (p *BufferPool) PutBuffer(buf *bytes.Buffer)

type Copier

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

func NewCopier

func NewCopier(ctx context.Context) *Copier

func (*Copier) Copy

func (c *Copier) Copy(dst io.Writer, src io.Reader) (int64, error)

func (*Copier) SetBlockSize

func (c *Copier) SetBlockSize(size int64) *Copier

func (*Copier) SetDelayTime

func (c *Copier) SetDelayTime(d time.Duration) *Copier

Jump to

Keyboard shortcuts

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