logcsv

package
v0.1.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logcsv 读写 Pulse 事件 CSV(event,seq,timestamp_ns,size)。

Index

Constants

View Source
const (
	SentUL = "SENT_UL"
	RecvUL = "RECV_UL"
	SentDL = "SENT_DL"
	RecvDL = "RECV_DL"
)

Event 类型常量。

Variables

This section is empty.

Functions

This section is empty.

Types

type Row

type Row struct {
	Event       string
	Seq         int64
	TimestampNs *int64 // nil 表示空(丢包)
	Size        int
}

Row 表示一行事件。

func ReadAll

func ReadAll(path string) ([]Row, error)

ReadAll 读取客户端或服务端 CSV 全部数据行(跳过表头)。

type Writer

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

Writer 追加写入事件 CSV。

func NewWriter

func NewWriter(path string) (*Writer, error)

NewWriter 创建 Writer 并写入表头。

func (*Writer) Close

func (w *Writer) Close() error

Close 刷盘并关闭文件。

func (*Writer) WriteRow

func (w *Writer) WriteRow(r Row) error

WriteRow 写入一行。

Source Files

  • logcsv.go

Jump to

Keyboard shortcuts

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