trace

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package trace provides interface and implementation for collecting communication with an CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTrace

func FormatTrace(tr Trace) string

Types

type CB

type CB func(operation Operation, data []byte)

type Item

type Item interface {
	GetTime() time.Time
	GetOperation() Operation
	GetData() []byte
}

type Operation

type Operation int64
const (
	Unknown Operation = 0
	Write   Operation = 1
	Read    Operation = 2
)

func (Operation) String

func (l Operation) String() string

type Trace

type Trace interface {
	Add(s Operation, data []byte)
	List() []Item
}

type TraceImp

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

func NewTraceImp

func NewTraceImp() *TraceImp

func NewTraceLimited

func NewTraceLimited(limit int) *TraceImp

func (*TraceImp) Add

func (m *TraceImp) Add(op Operation, data []byte)

func (*TraceImp) List

func (m *TraceImp) List() []Item

Jump to

Keyboard shortcuts

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