flow

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package flow 实现字节统计,读,写,读写统计,以字节为准. 三个参数为空时,无任何统计

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flow

type Flow struct {
	io.ReadWriter
	Wc *atomic.Uint64 // 写统计
	Rc *atomic.Uint64 // 读统计
	Tc *atomic.Uint64 // 读写统计
}

Flow io流统计

func (*Flow) Read

func (sf *Flow) Read(p []byte) (int, error)

Read reads up to len(p) bytes into p.

func (*Flow) Write

func (sf *Flow) Write(p []byte) (int, error)

Write writes len(p) bytes from p to the underlying data stream.

Jump to

Keyboard shortcuts

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