Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snabb/diagio
Go package diagio implements I/O wrappers for debugging and diagnostics. (golang)
https://github.com/snabb/diagio
go golang
Last synced: 3 months ago
JSON representation
Go package diagio implements I/O wrappers for debugging and diagnostics. (golang)
- Host: GitHub
- URL: https://github.com/snabb/diagio
- Owner: snabb
- License: mit
- Created: 2017-03-01T21:57:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-23T08:17:06.000Z (over 1 year ago)
- Last Synced: 2024-06-21T00:13:33.560Z (5 months ago)
- Topics: go, golang
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - diagio
README
diagio
======[![Go Reference](https://pkg.go.dev/badge/github.com/snabb/diagio.svg)](https://pkg.go.dev/github.com/snabb/diagio)
[![Build Status](https://github.com/snabb/diagio/actions/workflows/go.yml/badge.svg)](https://github.com/snabb/diagio/actions/workflows/go.yml)
[![codecov](https://codecov.io/gh/snabb/diagio/branch/master/graph/badge.svg)](https://codecov.io/gh/snabb/diagio)
[![Go Report Card](https://goreportcard.com/badge/github.com/snabb/diagio)](https://goreportcard.com/report/github.com/snabb/diagio)The Go package diagio implements I/O wrappers which can be useful for
debugging and other diagnostics purposes.`CounterReader` implements an `io.Reader` wrapper which keeps track of number
of bytes read from it.`CounterWriter` implements an `io.Writer` wrapper which keeps track of number
of bytes written to it.`DiagReader` implements an `io.Reader` wrapper which produces diagnostics
output (number of bytes, current position, error, hex dump of data) whenever
it is read from.`DiagWriter` implements an `io.Writer` wrapper which produces diagnostics
output (number of bytes, current position, error, hex dump of data) whenever
it is written to.Documentation:
https://pkg.go.dev/github.com/snabb/diagio
Simple example:
```
cw := diagio.NewCounterWriter(os.Stdout)
fmt.Fprintln(cw, "hello world")
fmt.Println(cw.Count())
// Output:
// hello world
// 12
```The Git repository is located at: https://github.com/snabb/diagio
License
-------MIT