gool

command module
v0.0.0-...-4c9c0b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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
url-to-json Convert url to JSON
base64-encode Base64 encode
base64-decode Base64 decode
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
format-json Cleans and format JSON

Library

package main

import (
	"fmt"

	"github.com/functionalc/gool/pkg/cases"
	"github.com/functionalc/gool/pkg/date"
	"github.com/functionalc/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

💻

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg
jwt
url

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL