Categorygithub.com/cloudingcity/gool
modulepackage
0.11.0
Repository: https://github.com/cloudingcity/gool.git
Documentation: pkg.go.dev

# README

Gool

Test Lint Deploy codecov Go Report Card

📦 A toolkit make your programmer life easier.

Inspired by Boop

demo

Installation

Homebrew

brew install cloudingcity/tap/gool

Docker

docker run --rm -it ghost0436/gool

Usage

$ 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 
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=#

Scripts

ScriptDescription
timestamp-to-date, t2dCovert unix timestamp to date
date-to-timestamp, d2tCovert date to unix timestamp
jwt-decodeDecode JWT
md5Computes the checksum
url-encodeEncode url
url-decodeDecode url
url-to-jsonConvert url to JSON
base64-encodeBase64 encode
base64-decodeBase64 decode
rand-stringGenerate random string of given length (characters: a-z, A-Z, 0-9)
countGet the characters length
camel-caseCoverts string to camel case
kebab-caseCoverts string to kebab case
lower-caseCoverts string to lower case
snake-caseCoverts string to snake case
start-caseCoverts string to start case
upper-caseCoverts string to upper case
format-jsonCleans and format JSON

Library

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
}

Contributors


Clouding

💻

LeoZhan

💻

Toby Lam

💻

# Packages

No description provided by the author
No description provided by the author