mirror of https://github.com/miguelmota/cointop
abstract color
parent
623c0be612
commit
187f30f5c7
@ -0,0 +1,14 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
.DS_Store
|
@ -0,0 +1,21 @@
|
||||
MIT license
|
||||
|
||||
Copyright (C) 2015 Miguel Mota
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -0,0 +1,10 @@
|
||||
package apis
|
||||
|
||||
import (
|
||||
cmc "github.com/miguelmota/cointop/apis/cmc"
|
||||
)
|
||||
|
||||
// NewCMC new CoinMarketCap api
|
||||
func NewCMC() Interface {
|
||||
return cmc.New()
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package color
|
||||
|
||||
import "github.com/fatih/color"
|
||||
|
||||
var (
|
||||
White = color.New(color.FgWhite).SprintFunc()
|
||||
Green = color.New(color.FgGreen).SprintFunc()
|
||||
Red = color.New(color.FgRed).SprintFunc()
|
||||
Cyan = color.New(color.FgCyan).SprintFunc()
|
||||
)
|
@ -0,0 +1,19 @@
|
||||
package pad
|
||||
|
||||
func times(str string, n int) (out string) {
|
||||
for i := 0; i < n; i++ {
|
||||
out += str
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Left left-pads the string with pad up to len runes
|
||||
// len may be exceeded if
|
||||
func Left(str string, length int, pad string) string {
|
||||
return times(pad, length-len(str)) + str
|
||||
}
|
||||
|
||||
// Right right-pads the string with pad up to len runes
|
||||
func Right(str string, length int, pad string) string {
|
||||
return str + times(pad, length-len(str))
|
||||
}
|
Loading…
Reference in New Issue