gouse

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 68 Imported by: 3

README

ci_status codeql_status sonar codacy DeepSource go_report_card codecov circleci go.dev documentation_website gouse_functions_count GitHub code size in bytes

Banner


Made possible by my Sponsor Program 💖

🧠 Why Gouse?

  • Gouse is a modern essential Golang utility package delivering consistency, modularity, performance, & extras presets inspired by Lodash.
  • Built on top of Go language, combined with others Go open-source packages.
  • Javascript user-friendly syntax.
  • No config - import as utility functions.
  • Lightweight package: easy to use, chainable, and extendable, and available in various builds & module formats.
  • Gouse provides a wide variety of available methods, taking the hassle out of working with arrays, numbers, objects, strings, etc. Each method has different features, so you can pick the ones that fit your project best.
  • Comprehensive documentation and examples.
  • Powerful package that is suitable for small to large projects and compatible with all OS platforms
  • Thanks to Gouse, you can:
    • Set up and scale projects rapidly.
    • Handle complex logic use-cases such as database connection, build APIs, error handling, log management...
    • Optimize performance and increase productivity.
    • Build easily consistent systems with available functions.
    • Avoid writing repetitive code and a unified code style.
    • Reduce the number of lines of code and make it easier to read, understand, and maintain.
    • Avoid compatibility conflicts and unexpected errors.
    • And more...

✨ Motivation

  • Go has emerged as a server language, but it still doesn't have complete and consistent packages available to support coding development.
    • Developers must write by hand or search manually. That wastes time and even causes many compatibility conflicts
    • Must update each dependent package every time you update
    • Unexpected errors can easily arise during execution
    • Performance is not optimized
    • The number of lines of code is very long that not easy to read and understand
    • Code logic may not be consistent, making it difficult to maintain and scale

👉 To address that need, Gouse was created as a powerful toolkit for Go developers, a collection of built-in functions and best practices that provide comprehensive, powerful, and reliable solutions. Trusted to build services, APIs, and web applications.

🚀 Module packages

Below is a list of modules that Gouse supports. This project is still in development stage, so not all features are available.

📋 Requirements

Compatibility with Go >= 1.18

📦 Installation

go get github.com/thuongtruong109/gouse

🕯️ Quick Start

package main

import "github.com/thuongtruong109/gouse"

func main() {
    gouse.Stater()
}

🦄 Usage

  • Using package directly in your module as ultra-lightweight utility functions.
package main

import "github.com/thuongtruong109/gouse"

func main() {
    gouse.Print(gouse.Add(1, 2))
}
  • View more examples at sample folder.

📖 Documentation

  • To read the completely package documentation guide, reference at Dev package

📊 Benchmark

GOOS: windows

GOARCH: amd64

CPU: AMD Ryzen 5 5600U with Radeon Graphics (12) @ 2.300GHz

ITERATIONS: 5

INPUT: 1000000

📁 Project Structure

Project Structure

🛠️ Development

$ git clone https://github.com/thuongtruong109/gouse.git

📝 Contributing

  • We welcome your contributions! If you're looking for issues to work on, try looking at the good first issue list. We do our best to tag issues suitable for new external contributors with that label, so it's a great way to find something you can help with!

  • Please read our Code of Conduct before contributing.

  • Refer to the Contributing Guide for more information on how to get started.

📄 License

📌 Support

  • The tool has been tested on a variety of inputs, but it's not perfect.
  • For support in using Gouse, please reach out in the following venues:
    • Raise Issues - For generally applicable issues and feedback.
    • Join Discussions - For ideas, questions, or issues regarding Gouse's design, development, and future.

📜 Changelog

  • Gouse is under active development. This means that new features, bug fixes, and breaking changes will be released frequently. We encourage you to keep the CHANGELOG open while upgrading to see what's new!

  • For more information on how to use the changelog, please refer to Keeping a Changelog.

🌸 Sponsor

  • If you like this project, you can sponsor me on:

Github sponsor Paypal Kofi

📮 Contact

  • If you have any questions, please contact me:

Email Github Linkedin Facebook

🧬 Dependencies

  • Gouse is built on top of the following below and others open-source projects

  • Special thanks to the following dependencies that helped make this project possible:

    • Google UUID - A fast and simple UUID library for Go 🔑
    • Survey v2 - A golang library for building interactive prompts with full support for windows and posix terminals 🙋
    • Bubbletea - A powerful little TUI framework 🏗
    • Go Cache - An in-memory key:value store/cache (similar to Memcached) 🗄
    • Crypto - A collection of cryptographic algorithms and protocols for Go 📦
    • Go eCharts - 🎨 The adorable charts library for Golang 📊
    • Env config x Go Toml - A Go library for managing configuration data from files 📄
    • Minio Client Go v7 - MinIO Go Library for Amazon S3 compatible cloud storage 📦
    • Mongodb Go driver - The MongoDB supported driver for Go 📦
    • Redis Go v8 - Type-safe Redis client for Golang 📦
    • Cache for Go - An in-memory key:value store/cache (similar to Memcached) library for Go 🗄
    • Toml Go - A Go library for managing configuration data from files 📄
    • Yaml - A YAML support for the Go language 📄

📚 References

Documentation

Index

Constants

View Source
const (
	INFO_LOG_PREFIX   string = "[INFO]"
	ERROR_LOG_PREFIX  string = "[ERROR]"
	ACCESS_LOG_PREFIX string = "[ACCESS]"
)
View Source
const (
	CHAIN_STR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}[]|:<>?/.,';][=-`~"
	CHAIN_NUM = "0123456789"
)
View Source
const (
	ERROR_LOG_PATH  = "logs/error.log"
	INFO_LOG_PATH   = "logs/info.log"
	ACCESS_LOG_PATH = "logs/access.log"
)
View Source
const (
	DESC_TEST    = "Expected %v but it got %v"
	DESC_CONSOLE = "Unsupported action type"
)
View Source
const (
	// These maybe not supported by all terminals
	DEFAULT_CONSOLE string = "\033[0m"
	RED_CONSOLE     string = "\033[31m"
	GREEN_CONSOLE   string = "\033[32m"
	YELLOW_CONSOLE  string = "\033[33m"
	PURPLE_CONSOLE  string = "\033[34m"
	PINK_CONSOLE    string = "\033[35m"
	CYAN_CONSOLE    string = "\033[36m"
	WHITE_CONSOLE   string = "\033[97m"
	ORANGE_CONSOLE  string = "\033[38;5;208m"
	BLUE_CONSOLE    string = "\033[38;5;27m"
	MAGENTA_CONSOLE string = "\033[38;5;13m"
	GRAY_CONSOLE    string = "\033[37m"
)
View Source
const (
	PasswordLenReg     = `^.{8,32}$`
	PasswordLowerReg   = `[a-z]`
	PasswordUpperReg   = `[A-Z]`
	PasswordDigitReg   = `\d`
	PasswordSpecialReg = `[!@#$%^&*]`
)
View Source
const (
	DESC_CREATE_FAILED string = "create failed"
	DESC_GET_FAILED    string = "get failed"
	DESC_UPDATE_FAILED string = "update failed"
	DESC_DELETE_FAILED string = "delete failed"

	DESC_CREATE_SUCCESS string = "create successfully"
	DESC_GET_SUCCESS    string = "get successfully"
	DESC_UPDATE_SUCCESS string = "update successfully"
	DESC_DELETE_SUCCESS string = "delete successfully"

	DESC_NOT_FOUND_DATA string = "not found data"
	DESC_EMPTY_DATA     string = "empty data"
	DESC_INVALID_DATA   string = "invalid data"
)
View Source
const (
	// basic symbols
	SCOPE_SYM     string = " ⦿ "
	INPUT_SYM     string = " » "
	AGAIN_SYM     string = " ↺ "
	EXIT_SYM      string = " ↵ "
	INFO_SYM      string = " ⚠ "
	QUESTION_SYM  string = " ? "
	SPAN_HOR_SYM  string = " ↔ "
	SPAN_VER_SYM  string = " ↕ "
	MORE_SYM      string = " ... "
	OK_SYM        string = " ✔ "
	NO_SYM        string = " ✘ "
	CROSS_SYM     string = " ✖ "
	ITEM_SYM      string = " ➤ "
	COPYRIGHT_SYM string = " © "
	TRADEMARK_SYM string = " ™ "
	REGISTER_SYM  string = " ® "
	AT_SYM        string = " @ "
	NUMERO_SYM    string = " № "
)
View Source
const (
	// arrow symbols
	TO_RIGHT_CON string = " → "
	TO_LEFT_SYM  string = " ← "
	TO_UP_SYM    string = " ↑ "
	TO_DOWN_SYM  string = " ↓ "
	ARROW3_SYM   string = " ⇨ "
	ARROW4_SYM   string = " ⇾ "
	ARROW5_SYM   string = " ⇛ "
	ARROW6_SYM   string = " ⇝ "
	ARROW7_SYM   string = " ⇢ "
	ARROW8_SYM   string = " ⇥ "
	LEFT_SYM     string = " ◀ "
	RIGHT_SYM    string = " ▶ "
	UP_SYM       string = " ▲ "
	DOWN_SYM     string = " ▼ "
)
View Source
const (
	// math symbols
	PLUS_SYM           string = " + "
	MINUS_SYM          string = " - "
	MULT_SYM           string = " * "
	DIV_SYM            string = " / "
	MOD_SYM            string = " % "
	OR_SYM             string = " | "
	AND_SYM            string = " & "
	NOT_EQUAL_SYM2     string = " != "
	LESS_SYM           string = " < "
	GREATER_SYM        string = " > "
	LESS_EQUAL_SYM2    string = " <= "
	GREATER_EQUAL_SYM2 string = " >= "
	APPROX_EQUAL_SYM2  string = " ~= "
	ASSIGN_SYM         string = " = "
	PLUS_ASSIGN_SYM    string = " += "
	MINUS_ASSIGN_SYM   string = " -= "
	MULT_ASSIGN_SYM    string = " *= "
	DIV_ASSIGN_SYM     string = " /= "
	SECTION_SYM        string = " § "
	PI_SYM             string = " π "
	INFINITY_SYM       string = " ∞ "
	NOT_EQUAL_SYM      string = " ≠ "
	LESS_EQUAL_SYM     string = " ≤ "
	GREATER_EQUAL_SYM  string = " ≥ "
	APPROX_EQUAL_SYM   string = " ≈ "
	PLUSMINUS_SYM      string = " ± "
	NOT_SYM            string = " ¬ "
	NANO_SYM           string = " n "
	MILLI_SYM          string = " m "
	KILO_SYM           string = " k "
	MEGA_SYM           string = " M "
	GIGA_SYM           string = " G "
	TERA_SYM           string = " T "
	PICO_SYM           string = " p "
	FEMTO_SYM          string = " f "
	ATTO_SYM           string = " a "
	ZEPTO_SYM          string = " z "
	YOCTO_SYM          string = " y "
	SQUARED_SYM        string = " ² "
	CUBED_SYM          string = " ³ "
	POWER_6_SYM        string = " ⁶ "
	POWER_9_SYM        string = " ⁹ "
	POWER_12_SYM       string = " ¹² "
	SQUARE_ROOT_SYM    string = " √ "
	CUBE_ROOT_SYM      string = " ∛ "
	// set symbols
	EMPTY_SET_SYM      string = " ∅ "
	SUBSET_SYM         string = " ⊂ "
	SUBSET_EQUAL_SYM   string = " ⊆ "
	SUPERSET_SYM       string = " ⊃ "
	SUPERSET_EQUAL_SYM string = " ⊇ "
	INTERSECTION_SYM   string = " ∩ "
	UNION_SYM          string = " ∪ "
	// logic symbols
	EXISTS_SYM     string = " ∃ "
	FORALL_SYM     string = " ∀ "
	NOT_EXISTS_SYM string = " ∄ "
	NOT_FORALL_SYM string = " ∁ "
	IMPLIES_SYM    string = " ⇒ "
	IMPLIES2_SYM   string = " ⟹ "
	IMPLIES3_SYM   string = " ⟼ "
	IMPLIES4_SYM   string = " ⟾ "
	IMPLIES5_SYM   string = " ⟺ "
	IMPLIES6_SYM   string = " ⟸ "
	IMPLIES7_SYM   string = " ⇔ "
	IMPLIES8_SYM   string = " ⇎ "
	IMPLIES9_SYM   string = " ⇏ "
	IMPLIES10_SYM  string = " ⇍ "
	IMPLIES13_SYM  string = " ⇐ "
	IMPLIES15_SYM  string = " ⇌ "
)
View Source
const (
	// physics symbols
	OHM_SYM            string = " Ω "
	ANGSTROM_SYM       string = " Å "
	DEGREE_C_SYM       string = " ℃ "
	DEGREE_F_SYM       string = " ℉ "
	DEGREE_SYM         string = " ° "
	DEGREE_K_SYM       string = " K "
	DEGREE_R_SYM       string = " °R "
	DEGREE_REAUMUR_SYM string = " °Ré "
	DEGREE_RANKINE_SYM string = " °Ra "
	DEGREE_NEWTON_SYM  string = " °N "
	DEGREE_DELISLE_SYM string = " °De "
	DEGREE_ROMER_SYM   string = " °Rø "
	DEGREE_GALILEO_SYM string = " °G "
)
View Source
const (
	// chemistry symbols
	DEGREE_BAUME_SYM    string = " °Bé "
	DEGREE_TWADDELL_SYM string = " °Tw "
)
View Source
const (
	// greek symbols
	ALPHA_SYM   string = " α "
	BETA_SYM    string = " β "
	GAMMA_SYM   string = " γ "
	DELTA_SYM   string = " δ "
	EPSILON_SYM string = " ε "
	ZETA_SYM    string = " ζ "
	ETA_SYM     string = " η "
	THETA_SYM   string = " θ "
	IOTA_SYM    string = " ι "
	KAPPA_SYM   string = " κ "
	LAMBDA_SYM  string = " λ "
	MU_SYM      string = " μ "
	NU_SYM      string = " ν "
	XI_SYM      string = " ξ "
	OMICRON_SYM string = " ο "
	PI_SYM2     string = " π "
	RHO_SYM     string = " ρ "
	SIGMA_SYM   string = " σ "
	TAU_SYM     string = " τ "
	UPSILON_SYM string = " υ "
	PHI_SYM     string = " φ "
	CHI_SYM     string = " χ "
	PSI_SYM     string = " ψ "
	OMEGA_SYM   string = " ω "
)
View Source
const (
	// geometric symbols
	DOT_SYM        string = " • "
	CIRCLE_SYM     string = " ○ "
	SQUARE_SYM     string = " ■ "
	TRIANGLE_SYM   string = " △ "
	QUADRANGLE_SYM string = " □ "
	PENTAGON_SYM   string = " ⬟ "
	HEXAGON_SYM    string = " ⬡ "
	HEPTAGON_SYM   string = " ⬢ "
	OCTAGON_SYM    string = " ⬣ "
	ENNEAGON_SYM   string = " ⬤ "
	DECAGON_SYM    string = " ⬥ "
	HEXAGON2_SYM   string = " ⬦ "
	HEPTAGON2_SYM  string = " ⬧ "
	OCTAGON2_SYM   string = " ⬨ "
	ENNEAGON2_SYM  string = " ⬩ "
	DECAGON2_SYM   string = " ⬪ "
	HEXAGON3_SYM   string = " ⬫ "
	HEPTAGON3_SYM  string = " ⬬ "
	OCTAGON3_SYM   string = " ⬭ "
	ENNEAGON3_SYM  string = " ⬮ "
	DECAGON3_SYM   string = " ⬯ "
	HEXAGON4_SYM   string = " ⬰ "
	HEPTAGON4_SYM  string = " ⬱ "
	OCTAGON4_SYM   string = " ⬲ "
	ENNEAGON4_SYM  string = " ⬳ "
	DECAGON4_SYM   string = " ⬴ "
)
View Source
const (
	// currency symbols
	POUND_SYM     string = " £ "
	YEN_SYM       string = " ¥ "
	EURO_SYM      string = " € "
	CENT_SYM      string = " ¢ "
	DOLLAR_SYM    string = " $ "
	CURRENCY_SYM  string = " ¤ "
	PERMILLE_SYM  string = " ‰ "
	PERMYRIAD_SYM string = " ‱ "
	VIETNAM_SYM   string = " ₫ "
	ROUBLE_SYM    string = " ₽ "
	BAHT_SYM      string = " ฿ "
	INDIAN_SYM    string = " ₹ "
	RIAL_SYM      string = " ﷼ "
	LIRA_SYM      string = " ₤ "
	DRACHMA_SYM   string = " ₯ "
	NAIRA_SYM     string = " ₦ "
	PESETA_SYM    string = " ₧ "
	RUPEE_SYM     string = " ₨ "
	FRANC_SYM     string = " ₣ "
	LEU_SYM       string = " ₗ "
	AFGHANI_SYM   string = " ؋ "
)
View Source
const (
	// card symbols
	CLUB_SYM    string = " ♣ "
	DIAMOND_SYM string = " ♦ "
	HEART_SYM   string = " ♥ "
	SPADE_SYM   string = " ♠ "
)
View Source
const (
	// chess symbols
	WHITE_KING_SYM   string = " ♔ "
	WHITE_QUEEN_SYM  string = " ♕ "
	WHITE_ROOK_SYM   string = " ♖ "
	WHITE_BISHOP_SYM string = " ♗ "
	WHITE_KNIGHT_SYM string = " ♘ "
	WHITE_PAWN_SYM   string = " ♙ "
	BLACK_KING_SYM   string = " ♚ "
	BLACK_QUEEN_SYM  string = " ♛ "
	BLACK_ROOK_SYM   string = " ♜ "
	BLACK_BISHOP_SYM string = " ♝ "
	BLACK_KNIGHT_SYM string = " ♞ "
	BLACK_PAWN_SYM   string = " ♟ "
)
View Source
const (
	// weather symbols
	SUNNY_SYM              string = " ☀ "
	CLOUDY_SYM             string = " ☁ "
	RAIN_SYM               string = " ☂ "
	SNOW_SYM               string = " ☃ "
	THUNDERSTORM_SYM       string = " ☇ "
	SUNNY_CLOUDY_SYM       string = " ☼ "
	RAIN_CLOUDY_SYM        string = " ☂☁ "
	SNOW_CLOUDY_SYM        string = " ☃☁ "
	THUNDERSTORM_CLOUDY    string = " ☇☁ "
	SUNNY_RAIN_SYM         string = " ☀☂ "
	SUNNY_SNOW_SYM         string = " ☀☃ "
	SUNNY_THUNDERSTORM_SYM string = " ☀☇ "
	CLOUDY_RAIN_SYM        string = " ☁☂ "
	CLOUDY_SNOW_SYM        string = " ☁☃ "
	CLOUDY_THUNDERSTORM    string = " ☁☇ "
	RAIN_SNOW_SYM          string = " ☂☃ "
	RAIN_THUNDERSTORM_SYM  string = " ☂☇ "
	SNOW_THUNDERSTORM_SYM  string = " ☃☇ "
)
View Source
const (
	// astrological symbols
	SUN_SYM         string = " ☉ "
	MOON_SYM        string = " ☽ "
	MERCURY_SYM     string = " ☿ "
	VENUS_SYM       string = " ♀ "
	EARTH_SYM       string = " ⊕ "
	MARS_SYM        string = " ♂ "
	JUPITER_SYM     string = " ♃ "
	SATURN_SYM      string = " ♄ "
	URANUS_SYM      string = " ♅ "
	NEPTUNE_SYM     string = " ♆ "
	PLUTO_SYM       string = " ♇ "
	CONJUNCTION_SYM string = " ☌ "
	OPPOSITION_SYM  string = " ☍ "
	SEXTILE_SYM     string = " ⚹ "
	TRINE_SYM       string = " ⚸ "
	ASC_NODE_SYM    string = " ☊ "
	DESC_NODE_SYM   string = " ☋ "
	BLACK_MOON_SYM  string = " ☾ "
)
View Source
const (
	// religious symbols
	CHRISTIAN_SYM string = " ✝ "
	JEWISH_SYM    string = " ✡ "
	ISLAMIC_SYM   string = " ☪ "
	YIN_YANG_SYM  string = " ☯ "
)
View Source
const (
	EmailLenReg = `^.{8,32}$`
)
View Source
const (
	PhoneReg = `^\+\d{1,2}\s?\(\d{1,4}\)\s?\d{1,6}-\d{1,6}$`
)
View Source
const (
	UsernameReg = `^[a-zA-Z0-9_]{3,20}$`
)

Variables

View Source
var (
	ErrorRequiredUuid error = errors.New("uuid is required")
	ErrorInvalidUuid  error = errors.New("uuid is invalid")

	ErrorInvalidEmail error = errors.New("email is invalid")
	ErrorEmailLength  error = errors.New("email must be between 8 and 32 characters long")

	ErrorInvalidUsername error = errors.New("username is invalid, must be between 3 and 20 characters long and only contains letters, numbers and underscore")

	ErrorInvalidPassword      error = errors.New("password is invalid, must be between 8 and 32 characters long and contains at least one lowercase letter, one uppercase letter, one digit and one special character")
	ErrorPasswordLength       error = errors.New("password must be between 8 and 32 characters long")
	ErrorPasswordEmptyLower   error = errors.New("password must contain at least one lowercase letter")
	ErrorPasswordEmptyUpper   error = errors.New("password must contain at least one uppercase letter")
	ErrorPasswordEmptyDigit   error = errors.New("password must contain at least one digit")
	ErrorPasswordEmptySpecial error = errors.New("password must contain at least one special character")

	ErrorHashPassword    error = errors.New("error when encrypt password")
	ErrorComparePassword error = errors.New("password not match")

	ErrorInvalidPhone error = errors.New("phone is invalid")
)
View Source
var DOUBLE_ALPHA = IFontBannerType{
	`A`: {
		`╔═╗`,
		`╠═╣`,
		`╩ ╩`,
	},
	`B`: {
		`╔╗ `,
		`╠╩╗`,
		`╚═╝`,
	},
	`C`: {
		`╔═╗`,
		`║  `,
		`╚═╝`,
	},
	`D`: {
		`╦═╗`,
		`║ ║`,
		`╩═╝`,
	},
	`E`: {
		`╔═╗`,
		`║╣ `,
		`╚═╝`,
	},
	`F`: {
		`╔═╗`,
		`║╣ `,
		`╩  `,
	},
	`G`: {
		`╔═╗`,
		`║ ╦`,
		`╚═╝`,
	},
	`H`: {
		`╦ ╦`,
		`╠═╣`,
		`╩ ╩`,
	},
	`I`: {
		` ╦ `,
		` ║ `,
		` ╩ `,
	},
	`J`: {
		`╦═╦`,
		`  ║`,
		` ═╝`,
	},
	`K`: {
		`╦  ╦`,
		`╠═╔╝`,
		`╝ ╚`,
	},
	`L`: {
		`╦  `,
		`║  `,
		`╩═╝`,
	},
	`M`: {
		`╔╗╔╗`,
		`║║║║`,
		`╝╚╝╚`,
	},
	`N`: {
		`╔╗╔`,
		`║║║`,
		`╝╚╝`,
	},
	`O`: {
		`╔═╗`,
		`║ ║`,
		`╚═╝`,
	},
	`P`: {
		`╔═╗`,
		`╠═╝`,
		`╩  `,
	},
	`Q`: {
		`╔═╗`,
		`║ ║`,
		`╚═╚═`,
	},
	`R`: {
		`╔═╗`,
		`╠╔╝`,
		`╝╚╝`,
	},
	`S`: {
		`╔═╗`,
		`╚═╗`,
		`╚═╝`,
	},
	`T`: {
		`╔╦╗`,
		` ║ `,
		` ╩ `,
	},
	`U`: {
		`╦ ╦`,
		`║ ║`,
		`╚═╝`,
	},
	`V`: {
		`╦   ╦`,
		`╚╗ ╔╝`,
		` ╚╔╝`,
	},
	`W`: {
		`╦ ╦`,
		`║║║`,
		`╚╩╝`,
	},
	`X`: {
		`╚╔╝`,
		`╔╝╗`,
	},
	`Y`: {
		`╦ ╦`,
		`╚╔╝`,
		` ╩ `,
	},
	`Z`: {
		`╔═╗`,
		`╔═╝`,
		`╚═╝`,
	},
	`0`: {
		`╔═╗`,
		`║ ║`,
		`╚═╝`,
	},
	`1`: {
		` ╦ `,
		` ║ `,
		` ╩ `,
	},
	`2`: {
		`╔═╗`,
		`╔═╝`,
		`╚══`,
	},
	`3`: {
		`╔═╗`,
		`╚═╗`,
		`╚═╝`,
	},
	`4`: {
		`╦ ╦`,
		`╚═╣`,
		`  ╩`,
	},
	`5`: {
		`╔═╗`,
		`╚═╗`,
		`╚═╝`,
	},
	`6`: {
		`╔═╗`,
		`╠═╗`,
		`╚═╝`,
	},
	`7`: {
		`╔═╗`,
		` ═║`,
		`  ╩`,
	},
	`8`: {
		`╔═╗`,
		`╠═╣`,
		`╚═╝`,
	},
	`9`: {
		`╔═╗`,
		`╚═╣`,
		`╚═╝`,
	},
}

Functions

func Abs

func Abs(num int) int

func AbsF

func AbsF(num float64) float64

func Add

func Add(num1, num2 int) int

func AddF

func AddF(num1, num2 float64) float64

func AddStruct

func AddStruct(structInstance interface{}, fields map[string]interface{}) interface{}

func AppendFile

func AppendFile(path string, data []string) error

func AreaCircle

func AreaCircle(radius int) float64

func AreaCircleF

func AreaCircleF(radius float64) float64

func AreaCone

func AreaCone(radius, height int) float64

func AreaConeF

func AreaConeF(radius, height float64) float64

func AreaCube

func AreaCube(side int) int

func AreaCubeF

func AreaCubeF(side float64) float64

func AreaCylinder

func AreaCylinder(radius, height int) float64

func AreaCylinderF

func AreaCylinderF(radius, height float64) float64

func AreaEllipse

func AreaEllipse(major, minor int) float64

func AreaEllipseF

func AreaEllipseF(major, minor float64) float64

func AreaParallelogram

func AreaParallelogram(base, height int) int

func AreaParallelogramF

func AreaParallelogramF(base, height float64) float64

func AreaPolygon

func AreaPolygon(lenSide float64, numSide int) float64

func AreaRect

func AreaRect(length, width int) int

func AreaRectF

func AreaRectF(length, width float64) float64

func AreaRhombus

func AreaRhombus(diag1, diag2 int) int

func AreaRhombusF

func AreaRhombusF(diag1, diag2 float64) float64

func AreaSphere

func AreaSphere(radius int) float64

func AreaSphereF

func AreaSphereF(radius float64) float64

func AreaSquare

func AreaSquare(side int) int

func AreaSquareF

func AreaSquareF(side float64) float64

func AreaTrapezoid

func AreaTrapezoid(base1, base2, height int) float64

func AreaTrapezoidF

func AreaTrapezoidF(base1, base2, height float64) float64

func AreaTriangle

func AreaTriangle(base, height int) int

func AreaTriangleF

func AreaTriangleF(base, height float64) float64

func At

func At(s string, index int) string
func Banner(font IFontBannerType, s string)

func BoolToString

func BoolToString(data bool) string

func BytesToString

func BytesToString(data []byte) string

func CamelCase

func CamelCase(s string) string

func Capitalize

func Capitalize(sentence string) string

func Cbrt

func Cbrt(number int) int

func CbrtF

func CbrtF(number float64) float64

func Ceil

func Ceil(num float64) int

up to the nearest integer

func CheckHref

func CheckHref(url string) (bool, error)

func CheckHrefStatusCode

func CheckHrefStatusCode(url string) (int, error)

func CheckPort

func CheckPort(protocol, hostname string, port int) bool

func Chunk

func Chunk[T comparable](array []T, size int) [][]T

func Clamp

func Clamp(value int, min int, max int) int

func CleanFile

func CleanFile(path string) error

func CloneStruct

func CloneStruct(structInstance interface{}) interface{}

func Cls

func Cls()

func Cmd

func Cmd(defaultCmmand string, windowsCmmand ...string)

func CodePoint

func CodePoint(input string) []int

func CodePointAt

func CodePointAt(s string, index int) int

func Compact

func Compact[T interface{}](arr []T) []T

func Concat

func Concat(s ...string) string

func Confirm

func Confirm(label string) (bool, error)

func ConnectMinio

func ConnectMinio(ctx context.Context, conf MinioConf) (*minio.Client, error)

func ConnectMongo

func ConnectMongo(ctx context.Context, uri string) (*mongo.Client, error)

func ConnectRedis

func ConnectRedis(addr, pass string, dbNo ...int) *redis.Client

func ConnectRedisUri

func ConnectRedisUri(uri string) *redis.Client

func CopyFile

func CopyFile(oldPath, newPath string) error

func Cos

func Cos(angle int) float64

func CosF

func CosF(angle float64) float64

func Count

func Count(s string, substr ...string) int

func CreateBarChart

func CreateBarChart(options *IBarChartOpts)

func CreateCanvas

func CreateCanvas(size int, hexColor string) (*image.RGBA, error)

func CreateDir

func CreateDir(dir string) error

func CreateFile

func CreateFile(path string) error

func CreateLineChart

func CreateLineChart(options *ILineChartOpts)

func CreatePath

func CreatePath(relativePath string) error

func CreatePieChart

func CreatePieChart(options *IPieChartOpts)

func CurrentDir

func CurrentDir() (string, error)

func CustomCase

func CustomCase(s, sep string) string

func DashDate

func DashDate(date ...interface{}) string

func Day

func Day() int

func DecodeData

func DecodeData(input []byte) ([]byte, error)

func DecodeHref

func DecodeHref(s string) string

func DecryptFile

func DecryptFile(source string, password []byte)

func DecryptPassword

func DecryptPassword(password, receivedPassword string) error

func DeferWrapper

func DeferWrapper(mainFunc func() error, cleanupFunc func()) error

func DetectError

func DetectError(err interface{}) string

func DiagRect

func DiagRect(length, width int) float64

func DiagRectF

func DiagRectF(length, width float64) float64

func Diff

func Diff[T comparable](a, b []T) []T

func DiffTime

func DiffTime(t1, t2 time.Time) time.Duration

func DiffTimeNow

func DiffTimeNow(startTime time.Time) time.Duration

func Distance

func Distance(speed, time float64) float64

func Divide

func Divide(num1, num2 int) int

func DivideF

func DivideF(num1, num2 float64) float64

func DotDate

func DotDate(date ...interface{}) string

func Drop

func Drop[T comparable](arr []T, n ...int) []T

func EncodeData

func EncodeData(input []byte) ([]byte, error)

func EncodeHref

func EncodeHref(s string) string

func EncryptFile

func EncryptFile(source string, password []byte)

func EncryptPassword

func EncryptPassword(password string) (string, error)

func EndsWith

func EndsWith(s string, substr string) bool

func Equal

func Equal[T comparable](a, b T) bool

func Escape

func Escape(s string) string

func FIndex

func FIndex(s string, substr string) int

func Factorial

func Factorial(num int) int

func FilterBy

func FilterBy[T comparable](arr []T, f func(T) bool) []T

func FindBy

func FindBy[T comparable](arr []T, f func(T) bool) T

func FirstUpperCase

func FirstUpperCase(s string) string

func FloatToString

func FloatToString(data float64) string

func Floor

func Floor(num float64) int

down to the nearest integer

func ForBy

func ForBy[T comparable](arr []T, f func(T))

func FromCodePoint

func FromCodePoint(codePoint ...int) string

func FromCodePointAt

func FromCodePointAt(codePoint int) string

func GetStruct

func GetStruct(structInstance interface{}, fieldName string) interface{}

func GetTagName

func GetTagName(structInstance interface{}) []string

func Go2Md

func Go2Md(inputFilePath string, outputFilePath string)

func HasEmptyInStruct

func HasEmptyInStruct(structInstance interface{}, fieldName string) bool

func HasInStruct

func HasInStruct(structInstance interface{}, fieldName string) bool

func HealthCheck

func HealthCheck()

func Help

func Help(name string, options []*IHelpOptions)

func HexToRGBA

func HexToRGBA(hex string) (color.RGBA, error)

func HierarchyDir

func HierarchyDir(dir string) ([]string, error)

func Hour

func Hour() int

func HrefConnectTime

func HrefConnectTime(url string) (float64, error)

func HrefHeader

func HrefHeader(url string) (http.Header, error)

func ISODate

func ISODate(date ...interface{}) string

func InRange

func InRange(value int, min int, max int) bool

func Includes

func Includes(s string, substr string) bool

func IncludesArr

func IncludesArr[T comparable](array []T, value T) bool

func IndexBy

func IndexBy[T comparable](arr []T, f func(T) bool) int

func IndexOfArr

func IndexOfArr[T comparable](arr []T, value T) int

func IndexSubStr

func IndexSubStr(s, substr string) (int, int)

func IntToString

func IntToString(data int) string

func Intersect

func Intersect[T comparable](slices ...[]T) []T

func IntervalFunc

func IntervalFunc(fn func(), timeout int)

func IsArray

func IsArray(v interface{}) bool

func IsBool

func IsBool(v interface{}) bool

func IsByte

func IsByte(v interface{}) bool

func IsChannel

func IsChannel(v interface{}) bool

func IsComplex

func IsComplex(v interface{}) bool

func IsDigit

func IsDigit[T byte | rune](char T) bool

func IsEdu

func IsEdu(emailStr string) (bool, error)

func IsEmail

func IsEmail(emailStr, customDomain string) (bool, error)

func IsEmpty

func IsEmpty(v interface{}) bool

func IsError

func IsError(v interface{}) bool

func IsEven

func IsEven(num int) bool

func IsExistDir

func IsExistDir(dir string) (bool, error)

func IsExistFile

func IsExistFile(path string) (bool, error)

func IsFloat

func IsFloat(v interface{}) bool

func IsFunc

func IsFunc(v interface{}) bool

func IsGmail

func IsGmail(emailStr string) (bool, error)

func IsInt

func IsInt(v interface{}) bool

func IsLetter

func IsLetter[T byte | rune](char T) bool

func IsLower

func IsLower[T byte | rune](char T) bool

func IsMap

func IsMap(v interface{}) bool

func IsMatchReg

func IsMatchReg(regex, chain string) bool

func IsNil

func IsNil(v interface{}) bool

func IsNumber

func IsNumber(v interface{}) bool

func IsOdd

func IsOdd(num int) bool

func IsOutlook

func IsOutlook(emailStr string) (bool, error)

func IsPassword

func IsPassword(password string) (bool, error)

func IsPerfectSquare

func IsPerfectSquare(num int) bool

func IsPhone

func IsPhone(phone string) (bool, error)

func IsPointer

func IsPointer(v interface{}) bool

func IsPrime

func IsPrime(num int) bool

func IsRune

func IsRune(v interface{}) bool

func IsSlice

func IsSlice(v interface{}) bool

func IsString

func IsString(v interface{}) bool

func IsStruct

func IsStruct(v interface{}) bool

func IsUUID

func IsUUID(input string) (bool, error)

func IsUintptr

func IsUintptr(v interface{}) bool

func IsUnInt

func IsUnInt(v interface{}) bool

func IsUndefined

func IsUndefined(v interface{}) bool

func IsUnsafePointer

func IsUnsafePointer(v interface{}) bool

func IsUpper

func IsUpper[T byte | rune](char T) bool

func IsUsername

func IsUsername(username string) (bool, error)

func IsYahoo

func IsYahoo(emailStr string) (bool, error)

func IsZero

func IsZero(v interface{}) bool

func Join

func Join(s []string, separator string) string

func KebabCase

func KebabCase(s string) string

func KeyBy

func KeyBy[T comparable](arr []T, f func(T) bool) int

func LIndex

func LIndex(s string, substr string) int

func LTrim

func LTrim(s string) string

func Lines

func Lines(s string) int

func LoadBalancer

func LoadBalancer(proxyPort string, backends []IBackend)

func LockFunc

func LockFunc(callback interface{}) interface{}

func Log

func Log(number, base int) int

func Log10

func Log10(number int) int

func Log10F

func Log10F(number float64) float64

func Log2

func Log2(number int) int

func Log2F

func Log2F(number float64) float64

func LogF

func LogF(number, base float64) float64

func LongDate

func LongDate(date ...interface{}) string

func Lower

func Lower[T byte | rune](char T) T

func LowerFirst

func LowerFirst(s string) string

func Lowers

func Lowers(s string) string

func LsDir

func LsDir(dir string) ([]string, error)

func MapAsString

func MapAsString[T string | []string](data map[string]T) string

MapAsString is not yet in example

func MapBy

func MapBy[T comparable, R comparable](arr []T, f func(T) R) []R

func MatchIndexReg

func MatchIndexReg(regex, chain string) int

func MatchReg

func MatchReg(regex, chain string) []string

func Max

func Max(nums ...int) int

func MaxArr

func MaxArr[T int | int8 | int16 | int32 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 | string](arr []T) T

func MaxF

func MaxF(nums ...float64) float64

func Mean

func Mean(nums ...int) int

func MeanF

func MeanF(nums ...float64) float64

func Merge

func Merge[T comparable](arr ...[]T) []T

func MergeStruct

func MergeStruct(structs ...interface{}) interface{}

func Min

func Min(nums ...int) int

func MinArr

func MinArr[T int | int8 | int16 | int32 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 | string](arr []T) T

func MinF

func MinF(nums ...float64) float64

func Minute

func Minute() int

func Month

func Month() int

func MonthDate

func MonthDate(date ...interface{}) string

func Most

func Most[T comparable](arr []T) T

func Multi

func Multi(nums ...int) int

func MultiF

func MultiF(nums ...float64) float64

func NormalDate

func NormalDate(date ...interface{}) string

func OpenHref

func OpenHref(url string)

func OutputColor

func OutputColor[T interface{}](color string, output T)

func OutputError

func OutputError(output string, err string)

func OutputSuccess

func OutputSuccess(output string)

func PNGToJPG

func PNGToJPG(input, output string) error

func PadEnd

func PadEnd(s string, addAmount int, padChar byte) string

func PadStart

func PadStart(s string, addAmount int, padChar byte) string

func ParallelizeFunc

func ParallelizeFunc(functions ...func())

func PeriCircle

func PeriCircle(radius int) float64

func PeriCircleF

func PeriCircleF(radius float64) float64

func PeriCube

func PeriCube(side int) int

func PeriCubeF

func PeriCubeF(side float64) float64

func PeriRect

func PeriRect(length, width int) int

func PeriRectF

func PeriRectF(length, width float64) float64

func PeriSquare

func PeriSquare(side int) int

func PeriSquareF

func PeriSquareF(side float64) float64

func PeriTriangle

func PeriTriangle(side1, side2, side3 int) int

func PeriTriangleF

func PeriTriangleF(side1, side2, side3 float64) float64

func Pow

func Pow(base, exp int) int

func Pow2

func Pow2(base int) int

func Pow2F

func Pow2F(base float64) float64

func Pow3

func Pow3(base int) int

func Pow3F

func Pow3F(base float64) float64

func PowF

func PowF(base, exp float64) float64

func Print

func Print(args ...interface{})

func PrintUsage

func PrintUsage(name string, options []*IHelpOptions)

func Printf

func Printf(format string, args ...interface{})

func Println

func Println(args ...interface{})

func Profile

func Profile(cpuprofile, memprofile string)

func Proxy

func Proxy(port string, urls []string)

func Pytago

func Pytago(side1, side2 int) float64

func PytagoF

func PytagoF(side1, side2 float64) float64

func RTrim

func RTrim(s string) string

func RWLockFunc

func RWLockFunc(callback interface{}) interface{}

func RandDigit

func RandDigit(n int) string

func RandID

func RandID() string

func RandNum

func RandNum(min, max int) int

func RandStr

func RandStr(n int) string

func ReadFileByLine

func ReadFileByLine(path string) ([]string, error)

func ReadFileObj

func ReadFileObj[T any](path string) ([]T, error)

func ReadJSON

func ReadJSON[T any](path string, configuration *T) error

func ReadPath

func ReadPath(relativePath string) ([]byte, error)

func ReadRequest

func ReadRequest(ctxBind func() error, ctxReq func() context.Context, req interface{}) error

func ReadTOML

func ReadTOML[T any](path string, configuration *T) error

func ReadYAML

func ReadYAML[T any](path string, configuration *T) error

func RejectBy

func RejectBy[T comparable](arr []T, f func(T) bool) []T

func RemainFunc

func RemainFunc(fn func(), attempts int)

func Remainder

func Remainder(num1, num2 int) int

func RemoveDir

func RemoveDir(dir string) error

func RemoveFile

func RemoveFile(path string) error

func RemoveStruct

func RemoveStruct(structInstance interface{}, fields ...string) interface{}

func RenameFile

func RenameFile(oldPath, newPath string) error

func Repeat

func Repeat(s string, count int) string

func Replace

func Replace(s string, old string, new string) string

func RetryFunc

func RetryFunc(fn func() error, attempts int, sleep int) (err error)

func Reverse

func Reverse(s string) string

func ReverseDate

func ReverseDate(date ...interface{}) string

func Root

func Root(number, n int) int

func RootF

func RootF(number, n float64) float64

func RotateLog

func RotateLog(output string, maxFileSize ...int64)

func Round

func Round(num float64) int

round to the nearest integer

func RunJob

func RunJob(duration, stopAfter uint64, callback func())

func RunTimeFunc

func RunTimeFunc(startTime time.Time, task func()) time.Duration

func RuneToString

func RuneToString(data rune) string

func ScanPort

func ScanPort(protocol, hostname string, start, end int)

func Second

func Second() int

func Select

func Select(label string, options []string) (string, error)

func SetCtx

func SetCtx(ctx context.Context)

func SetStruct

func SetStruct(structInstance interface{}, fieldName string, value interface{})

func Sin

func Sin(angle int) float64

func SinF

func SinF(angle float64) float64

func SleepHour

func SleepHour(hour int)

func SleepMinute

func SleepMinute(minute int)

func SleepSecond

func SleepSecond(second int)

func Slice

func Slice(s string, index ...int) string

func SnakeCase

func SnakeCase(s string) string

func SpaceCase

func SpaceCase(s string) string

func SpaceDate

func SpaceDate(date ...interface{}) string

func Speed

func Speed(distance, time float64) float64

func Splice

func Splice(s string, start, replaceCount int, items ...string) string

func Split

func Split(s string, separator string) []string

func Sprint

func Sprint(args ...interface{}) string

func Sprintf

func Sprintf(format string, args ...interface{}) string

func Sprintln

func Sprintln(args ...interface{}) string

func Sqrt

func Sqrt(number int) int

func SqrtF

func SqrtF(number float64) float64

func Starter

func Starter()

func StartsWith

func StartsWith(s string, substr string) bool

func StringToBool

func StringToBool(data string) bool

func StringToBytes

func StringToBytes(data string) []byte

func StringToFloat

func StringToFloat(data string) float64

func StringToInt

func StringToInt(data string) int

func StringsToBytes

func StringsToBytes(data []string) []byte

func StructToMap

func StructToMap(data interface{}) map[string]interface{}

func StructToString

func StructToString(data interface{}) string

func Sub

func Sub(num1, num2 int) int

func SubF

func SubF(num1, num2 float64) float64

func SubStr

func SubStr(s string, start int, length ...int) string

func Sum

func Sum(nums ...int) int

func SumArr

func SumArr[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 | complex64 | complex128](arr []T) T

func SumF

func SumF(nums ...float64) float64

func Tan

func Tan(angle int) float64

func TanF

func TanF(angle float64) float64

func TerminalClock

func TerminalClock()

func Time

func Time(distance, speed float64) float64

func ToHour

func ToHour(hour int) time.Duration

func ToMinute

func ToMinute(minute int) time.Duration

func ToSecond

func ToSecond(second int) time.Duration

func ToString

func ToString(data interface{}) string

func Trim

func Trim(s string) string

func TrimBlank

func TrimBlank(s string) string

func TrimPrefix

func TrimPrefix(s, prefix string) string

func TrimSuffix

func TrimSuffix(s, suffix string) string

func Truncate

func Truncate(s string, length int, omission ...string) string

func TruncateFile

func TruncateFile(path string, size int64) error

func UTCDate

func UTCDate(date ...interface{}) string

func UUID

func UUID() string

func UnderlineDate

func UnderlineDate(date ...interface{}) string

func Unescape

func Unescape(s string) string

func Unix

func Unix() int64

func UnixMicro

func UnixMicro() int64

func UnixMicroToTime

func UnixMicroToTime(micro int64) time.Time

func UnixMilli

func UnixMilli() int64

func UnixMilliToTime

func UnixMilliToTime(milli int64) time.Time

func UnixNano

func UnixNano() int64

func UnixNanoToTime

func UnixNanoToTime(nano int64) time.Time

func Unzip

func Unzip(zipFile, destFolder string) error

func Upper

func Upper[T byte | rune](char T) T

func UpperFirst

func UpperFirst(s string) string

func Uppers

func Uppers(s string) string

func VolCone

func VolCone(radius, height int) float64

func VolConeF

func VolConeF(radius, height float64) float64

func VolCube

func VolCube(side int) int

func VolCubeF

func VolCubeF(side float64) float64

func VolCylinder

func VolCylinder(radius, height int) float64

func VolCylinderF

func VolCylinderF(radius, height float64) float64

func VolRect

func VolRect(length, width, height int) int

func VolRectF

func VolRectF(length, width, height float64) float64

func VolSphere

func VolSphere(radius int) float64

func VolSphereF

func VolSphereF(radius float64) float64

func Weekday

func Weekday() int

func Words

func Words(s string) []string

func WriteAccessLog

func WriteAccessLog(msg string)

func WriteErrorLog

func WriteErrorLog(msg string, err interface{})

func WriteFile

func WriteFile(path string, data []string) error

func WriteFileObj

func WriteFileObj[T any](path string, data T) error

func WriteInfoLog

func WriteInfoLog(msg string)

func WriteLog

func WriteLog(prefix, msg, filePath string, err ...interface{})

func WriteLogDefault

func WriteLogDefault(logID, logMessage, output string)

func WritePath

func WritePath(relativePath string, content []byte) error

func Year

func Year() int

func Zip

func Zip(zipFileName string, files []string) error

Types

type Ctx

type Ctx context.Context

func GetCtx

func GetCtx() Ctx

type DelayedResult

type DelayedResult[T any] struct {
	Value     T
	HasReturn bool
}

func DelayF

func DelayF[T any](f func() T, timeout int) DelayedResult[T]

func DelayFunc

func DelayFunc(f func(), timeout int) DelayedResult[struct{}]

type FileInfoStruct

type FileInfoStruct struct {
	Name    string
	Size    int64
	Mode    os.FileMode
	ModTime string
	IsDir   bool
	Sys     interface{}
	All     os.FileInfo
}

func FileInfo

func FileInfo(path string) (*FileInfoStruct, error)

type Function

type Function struct {
	Import string
	Order  string
	Name   string
	Desc   string
	Body   string
}

func ExtractFunctions

func ExtractFunctions(code []byte) []Function

func (*Function) HighlightBody

func (f *Function) HighlightBody() string

func (*Function) HighlightDesc

func (f *Function) HighlightDesc() string

func (*Function) HighlightImport

func (f *Function) HighlightImport() string

func (*Function) HighlightName

func (f *Function) HighlightName() string

type IBackend

type IBackend struct {
	URL    string `json:"url"`
	IsDead bool
	// contains filtered or unexported fields
}

func (*IBackend) GetIsDead

func (backend *IBackend) GetIsDead() bool

func (*IBackend) SetDead

func (backend *IBackend) SetDead(b bool)

type IBarChartItem

type IBarChartItem struct {
	Name   string
	Values []float64
}

type IBarChartOpts

type IBarChartOpts struct {
	Output   string
	Title    string
	Subtitle string
	XAxis    []string
	Items    []IBarChartItem
}

type ICPU

type ICPU struct {
	ModelName string
	Family    string
	Speed     string
	Cores     int
}

func CPU

func CPU() (*ICPU, error)

type ICronJob

type ICronJob struct {
	// contains filtered or unexported fields
}

func NewCronJob

func NewCronJob(duration, stopAfter time.Duration, callback func()) *ICronJob

func (*ICronJob) StartJob

func (cj *ICronJob) StartJob()

func (*ICronJob) WaitJob

func (cj *ICronJob) WaitJob()

type IDisk

type IDisk struct {
	TotalSpace       uint64
	FreeSpace        uint64
	UsedSpace        uint64
	UsedSpacePercent string
}

func Disk

func Disk() (*IDisk, error)

type IFontBannerType

type IFontBannerType map[string][3]string

type IGracefulShutdown

type IGracefulShutdown struct {
	Port          string
	StartMsg      string
	ShutdownMsg   string
	SleepTimout   time.Duration
	HeaderTimeout time.Duration
}

func (*IGracefulShutdown) GracefulShutdown

func (igs *IGracefulShutdown) GracefulShutdown()

type IHelpActionBool

type IHelpActionBool struct {
	Action func(bool)
}

type IHelpActionInt

type IHelpActionInt struct {
	Action func(int)
}

type IHelpActionStr

type IHelpActionStr struct {
	Action func(string)
}

type IHelpOptions

type IHelpOptions struct {
	Opt    string
	Desc   string
	Val    interface{}
	Action interface{}
}

type ILbConfig

type ILbConfig struct {
	ProxyPort string     `json:"proxy"`
	Backends  []IBackend `json:"backends"`
}

type ILineChartItem

type ILineChartItem struct {
	Name   string
	Values []float64
}

type ILineChartOpts

type ILineChartOpts struct {
	Output   string
	Title    string
	Subtitle string
	XAxis    []string
	Items    []ILineChartItem
}

type ILocalCache

type ILocalCache struct {
	Set  map[string]string
	Lock sync.RWMutex
}

func NewLocalCache

func NewLocalCache() *ILocalCache

func (*ILocalCache) AllLocalCache

func (c *ILocalCache) AllLocalCache() map[string]string

func (*ILocalCache) DelLocalCache

func (c *ILocalCache) DelLocalCache(key string)

func (*ILocalCache) FlushLocalCache

func (c *ILocalCache) FlushLocalCache()

func (*ILocalCache) GetLocalCache

func (c *ILocalCache) GetLocalCache(key string) (string, error)

func (*ILocalCache) SetLocalCache

func (c *ILocalCache) SetLocalCache(key, value string)

type ILog

type ILog struct {
	Prefix  string
	Message string
	Output  string
}

type IPieChartItem

type IPieChartItem struct {
	Name   string
	Values float64
}

type IPieChartOpts

type IPieChartOpts struct {
	Output    string
	Title     string
	Subtitle  string
	Radius    float64
	Format    string
	ShowLabel bool
	Items     []IPieChartItem
}

type ISystem

type ISystem struct {
	Name              string
	Platform          string
	Arch              string
	Hostname          string
	NumsProcs         uint64
	TotalMemory       uint64
	FreeMemory        uint64
	UsedMemory        uint64
	UsedMemoryPercent string
}

func System

func System() (*ISystem, error)

type ITest

type ITest struct {
	Name    string
	Input   string
	Want    bool
	WantErr bool
}

type ITmpCache

type ITmpCache struct {
	Expires time.Duration
	Set     *cache.Cache
}

func NewTmpCache

func NewTmpCache(expires ...time.Duration) *ITmpCache

func (*ITmpCache) AllTmpCache

func (c *ITmpCache) AllTmpCache() map[string]string

func (*ITmpCache) DelTmpCache

func (c *ITmpCache) DelTmpCache(cacheKey string)

func (*ITmpCache) FlushTmpCache

func (c *ITmpCache) FlushTmpCache()

func (*ITmpCache) GetTmpCache

func (c *ITmpCache) GetTmpCache(cacheKey string) interface{}

func (*ITmpCache) SetTmpCache

func (c *ITmpCache) SetTmpCache(cacheKey string, value interface{}, expireTime time.Duration)

type MinioConf

type MinioConf struct {
	Endpoint  string
	AccessKey string
	SecretKey string
	UseSSL    bool
	Bucket    string
	Location  string
}

type PgDB

type PgDB struct {
	Client *sql.DB
}

func ConnectPostgres

func ConnectPostgres(dsn string) (*PgDB, error)

Jump to

Keyboard shortcuts

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