A toolkit make your programmer life easier.
Inspired by Boop
brew install cloudingcity/tap/gool
docker run --rm -it ghost0436/gool
$ gool jwt-decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
$ gool shell
Gool Shell
\h: show help
=# \s jwt-decode
jwt-decode=# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
jwt-decode=#
Script | Description |
---|---|
timestamp-to-date, t2d | Covert unix timestamp to date |
date-to-timestamp, d2t | Covert date to unix timestamp |
jwt-decode | Decode JWT |
md5 | Computes the checksum |
url-encode | Encode url |
url-decode | Decode url |
rand-string | Generate random string of given length (characters: a-z, A-Z, 0-9) |
count | Get the characters length |
camel-case | Coverts string to camel case |
kebab-case | Coverts string to kebab case |
lower-case | Coverts string to lower case |
snake-case | Coverts string to snake case |
start-case | Coverts string to start case |
upper-case | Coverts string to upper case |
package main
import (
"fmt"
"github.com/cloudingcity/gool/pkg/cases"
"github.com/cloudingcity/gool/pkg/date"
"github.com/cloudingcity/gool/pkg/timestamp"
)
func main() {
fmt.Println(cases.Snake("HelloWorld"))
// hello_world
fmt.Println(cases.Camel("hello world"))
// helloWorld
fmt.Println(date.ToTimestamp("2020-09-01"))
// 1598918400 <nil>
fmt.Println(timestamp.ToDate(1598918400))
// 2020-09-01 08:00:00 +0800 CST
}