Popularity
2.9
Growing
Activity
1.8
-
39
2
8
Programming language: Go
License: MIT License
Tags:
Miscellaneous
Latest version: v1.0.2
datacounter alternatives and similar packages
Based on the "Miscellaneous" category.
Alternatively, view datacounter alternatives based on common mentions on social networks and blogs.
-
go-formatter
A curated list of awesome Go frameworks, libraries and software -
golang-standards/project-layout
Standard Go Project Layout -
archiver
Easily create & extract archives, and compress & decompress files of various formats -
ardanlabs/service
Starter code for writing web services in Go using Kubernetes. -
go-multierror
A Go (golang) package for representing a list of errors as a single error. -
go-restful-api
An idiomatic Go REST API starter kit (boilerplate) following the SOLID principles and Clean Architecture -
go-chat-bot
IRC, Slack, Telegram and RocketChat bot written in go -
xstrings
Implements string functions widely used in other languages but absent in Go. -
ghorg
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more 🥚 -
go-shortid
Super short, fully unique, non-sequential and URL friendly Ids -
health
An easy to use, extensible health check library for Go applications. -
gountries
Gountries provides: Countries (ISO-3166-1), Country Subdivisions(ISO-3166-2), Currencies (ISO 4217), Geo Coordinates(ISO-6709) as well as translations, country borders and other stuff exposed as struct data. -
banner
An easy way to add useful startup banners into your Go applications -
container
A lightweight yet powerful IoC dependency injection container for the Go programming language -
antch
Antch, a fast, powerful and extensible web crawling & scraping framework for Go -
golang-templates/seed
Go application GitHub repository template. -
healthcheck
An simple, easily extensible and concurrent health-check library for Go services
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
Promo
scoutapm.com
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of datacounter or a related project?
README
Datacounter
Golang counters for readers/writers.
Examples
ReaderCounter
buf := bytes.Buffer{}
buf.Write(data)
counter := datacounter.NewReaderCounter(&buf)
io.Copy(ioutil.Discard, counter)
if counter.Count() != dataLen {
t.Fatalf("count mismatch len of test data: %d != %d", counter.Count(), len(data))
}
WriterCounter
buf := bytes.Buffer{}
counter := datacounter.NewWriterCounter(&buf)
counter.Write(data)
if counter.Count() != dataLen {
t.Fatalf("count mismatch len of test data: %d != %d", counter.Count(), len(data))
}
http.ResponseWriter Counter
handler := func(w http.ResponseWriter, r *http.Request) {
w.Write(data)
}
req, err := http.NewRequest("GET", "http://example.com/foo", nil)
if err != nil {
t.Fatal(err)
}
w := httptest.NewRecorder()
counter := datacounter.NewResponseWriterCounter(w)
handler(counter, req)
if counter.Count() != dataLen {
t.Fatalf("count mismatch len of test data: %d != %d", counter.Count(), len(data))
}