mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
libs/common: Refactor libs/common 4 (#4237)
* libs/common: Refactor libs/common 4 - move byte function out of cmn to its own pkg - move tempfile out of cmn to its own pkg - move throttletimer to its own pkg ref #4147 Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * add changelog entry * fix linting issues
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
[*.sh]
|
||||
indent_style = tab
|
||||
|
||||
[*.proto]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
5
libs/.gitignore
vendored
5
libs/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
*.sw[opqr]
|
||||
vendor
|
||||
.glide
|
||||
|
||||
pubsub/query/fuzz_test/output
|
||||
@@ -1,44 +0,0 @@
|
||||
# TMLIBS
|
||||
|
||||
This repo is a home for various small packages.
|
||||
|
||||
## autofile
|
||||
|
||||
Autofile is file access with automatic log rotation. A group of files is maintained and rotation happens
|
||||
when the leading file gets too big. Provides a reader for reading from the file group.
|
||||
|
||||
## cli
|
||||
|
||||
CLI wraps the `cobra` and `viper` packages and handles some common elements of building a CLI like flags and env vars for the home directory and the logger.
|
||||
|
||||
## clist
|
||||
|
||||
Clist provides a linked list that is safe for concurrent access by many readers.
|
||||
|
||||
## common
|
||||
|
||||
Common provides a hodgepodge of useful functions.
|
||||
|
||||
## events
|
||||
|
||||
Events is a synchronous PubSub package.
|
||||
|
||||
## flowrate
|
||||
|
||||
Flowrate is a fork of https://github.com/mxk/go-flowrate that added a `SetREMA` method.
|
||||
|
||||
## log
|
||||
|
||||
Log is a log package structured around key-value pairs that allows logging level to be set differently for different keys.
|
||||
|
||||
## merkle
|
||||
|
||||
Merkle provides a simple static merkle tree and corresponding proofs.
|
||||
|
||||
## process
|
||||
|
||||
Process is a simple utility for spawning OS processes.
|
||||
|
||||
## pubsub
|
||||
|
||||
PubSub is an asynchronous PubSub package.
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package bytes
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package bytes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package bytes
|
||||
|
||||
// Fingerprint returns the first 6 bytes of a byte slice.
|
||||
// If the slice is less than 6 bytes, the fingerprint
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package tempfile
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package tempfile
|
||||
|
||||
// Need access to internal variables, so can't use _test package
|
||||
|
||||
15
libs/test.sh
15
libs/test.sh
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# run the linter
|
||||
# make lint
|
||||
|
||||
# run the unit tests with coverage
|
||||
echo "" > coverage.txt
|
||||
for d in $(go list ./... | grep -v vendor); do
|
||||
go test -race -coverprofile=profile.out -covermode=atomic "$d"
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package timer
|
||||
|
||||
import (
|
||||
"sync"
|
||||
@@ -1,4 +1,4 @@
|
||||
package common
|
||||
package timer
|
||||
|
||||
import (
|
||||
"sync"
|
||||
Reference in New Issue
Block a user