https://github.com/spatialcurrent/go-counter
Simple library and command line program for generating frequency distributions.
https://github.com/spatialcurrent/go-counter
big-data bigdata data
Last synced: 6 days ago
JSON representation
Simple library and command line program for generating frequency distributions.
- Host: GitHub
- URL: https://github.com/spatialcurrent/go-counter
- Owner: spatialcurrent
- License: mit
- Created: 2018-09-07T12:33:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-21T02:10:40.000Z (over 6 years ago)
- Last Synced: 2023-07-27T22:38:22.319Z (over 2 years ago)
- Topics: big-data, bigdata, data
- Language: Go
- Homepage: https://godoc.org/github.com/spatialcurrent/go-counter/pkg/counter
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/spatialcurrent/go-counter/tree/master) [](https://goreportcard.com/report/spatialcurrent/go-counter) [](https://godoc.org/github.com/spatialcurrent/go-counter) [](https://github.com/spatialcurrent/go-counter/blob/master/LICENSE.md)
# go-counter
# Description
**go-counter** is a command line program and package for generating frequency distributions. The **gocounter** command line program supports the following operating systems and architectures.
| GOOS | GOARCH |
| ---- | ------ |
| darwin | amd64 |
| linux | amd64 |
| windows | amd64 |
| linux | arm64 |
# Installation
No installation is required. Just grab a [release](https://github.com/spatialcurrent/go-counter/releases). You might want to rename your binary to just `gocounter` (or `counter`) for convenience.
If you do have go already installed, you can just run using `go run main.go` or install with `make install`.
# Usage
### Go
You can import **go-counter** as a library with:
```go
import (
"github.com/spatialcurrent/go-counter/pkg/counter"
)
```
See [counter](https://godoc.org/github.com/spatialcurrent/go-counter/pkg/counter) in GoDoc for information on how to use Go API.
### CLI
On the command line use `gocounter --help` to view usage.
# Examples
### Go
See the examples in the [counter](https://godoc.org/github.com/spatialcurrent/go-counter/pkg/counter) package documentation.
### CLI
To print the 10 most frequent lines in a file as a JSON array use:
```shell
gocounter top -sejl -n 10 path/to/file
```
# Building
You can build all the released artifacts using `make build` or run the make target for a specific operating system and architecture.
# Testing
To run Go tests use `make test` (or `bash scripts/test.sh`), which runs unit tests, `go vet`, `go vet with shadow`, [errcheck](https://github.com/kisielk/errcheck), [ineffassign](https://github.com/gordonklaus/ineffassign), [staticcheck](https://staticcheck.io/), and [misspell](https://github.com/client9/misspell).
# Contributing
[Spatial Current, Inc.](https://spatialcurrent.io) is currently accepting pull requests for this repository. We'd love to have your contributions! Please see [Contributing.md](https://github.com/spatialcurrent/go-counter/blob/master/CONTRIBUTING.md) for how to get started.
# License
This work is distributed under the **MIT License**. See **LICENSE** file.