uymas

package module
v2.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

Uymas

Golang 常用包,快速实现命令行程序开发、struct合并、随机数等生成.

Go.Dev reference Report Card Goproxy.cn Go GitHub tag (latest by date) Go

代码仓库介绍

项目介绍

go 语言工具库 go-version: v1.20 (使其兼容 windows7)

  • source
    • bin 命令行解析工具

分支介绍

  • master 项目主分支
  • develop 开发分支
  • nestling 雏形分支,包含实验性的代码
# 分支合并顺序
nestling --> develop -->master
安装
# github
$ go get -u gitee.com/conero/uymas/v2

编译程序

# 压缩化编译
go build -o ./dist -ldflags "-s -w" ./cmd/...
bin

命令行行语法

$ [command] [<options>]

$ [command] [<options>]
# [<options>] 格式如下


# 1. 配置参数;全称以及简写
--set[=true]
# - 表示单字符; -x; -xy => -x -y ; -xzy => x=zy
-short[=true]


# 2. 二级命令(紧接着 [command])
$ [command] [<sub-command>] [<options>]
plugin sub command(PSC)

插件式子命令

通过扫描二进制所在目录"$/"及“$/plg"下可执行文件,若存在将其视为PSC。

支持命名格式:

  • $/$app-name name
  • $/$app_name name
  • $/name name
  • $/plg/$app-name name
  • $/plg/$app_name name
tinygo

Experimental/Try 尝试实验性支持 tinygo

  • 进行中(since 2022-12-22)

  • "reflect is not fully implemented")That Fprintln appears to be using reflection, which is not well supported under tinygo yet. (E2935)

使用
package main

import (
	"fmt"
	"gitee.com/conero/uymas/v2/cli/evolve"
)

// command struct
type test struct {
    Command
}

func main() {
	evl := evolve.NewEvolve()

    // register func
    evl.Command(func() {
        fmt.Println("Evolution For Index.")
    }, "index")

    // register struct
    evl.Command(new(test), "test", "t")
    log.Fatal(evl.Run())
}

Documentation

Overview

Package uymas is summary util library from the work experience, provides base version, author information and so on.

Major functional like `bin` (CLI-APP), `str`(string util), other more. Some of originated from work experience to enhance code reuse. The final directory is a convenient tool to realize command-line program development and other code.

Index

Constants

View Source
const (
	Version        = "2.0.0-rc.2" //dev is not product but development tag.
	Release        = "20241001"   // dev|20060102
	Since          = "20181030"
	Author         = "Joshua Conero"
	Email          = "conero@163.com"
	Name           = "uymas"
	PkgName        = "conero/uymas"
	TimeLayoutDate = "20060102" // date layout-20060102
)

Variables

This section is empty.

Functions

func GetBuildInfo

func GetBuildInfo() string

GetBuildInfo Get the relevant version information after injection with the -ldflags parameters gitHash, buildData, buildAuthor.

Output format such as: "(buildData gitHash)"

Types

This section is empty.

Directories

Path Synopsis
app
calc
Package calc enter string equations to implement numeric arithmetic
Package calc enter string equations to implement numeric arithmetic
scan
Package scan directory resource scanner
Package scan directory resource scanner
storage
Package storage experimental storage package
Package storage experimental storage package
svn
Package svn command parser.
Package svn command parser.
cli
Package cli basic command line definition and processing tools.
Package cli basic command line definition and processing tools.
ansi
Package ansi color code implementation for command line.
Package ansi color code implementation for command line.
chest
Package chest The command chest, provides common tool methods.
Package chest The command chest, provides common tool methods.
evolve
Package evolve version Command line, which supports more registration types than cli.
Package evolve version Command line, which supports more registration types than cli.
gen
Package gen Command line related generators, such as command to struct mappings
Package gen Command line related generators, such as command to struct mappings
cmd
Package culture [pinyin] the chinese pinyin
Package culture [pinyin] the chinese pinyin
digit
Package digit Provide digitization tools such as converting numbers to Chinese uppercase and commonly used strings.
Package digit Provide digitization tools such as converting numbers to Chinese uppercase and commonly used strings.
ganz
Package ganz Chinese Traditional Heavenly Stems and Earthly Branches(天干地支).
Package ganz Chinese Traditional Heavenly Stems and Earthly Branches(天干地支).
pinyin
Package pinyin the chinese pinyin.
Package pinyin the chinese pinyin.
pinyin/material
Package material the Material of pinyin dick, it's `embed`.
Package material the Material of pinyin dick, it's `embed`.
data
convert
Package convert common data converter, base "reflect".
Package convert common data converter, base "reflect".
input
Package input parses the string data to make it a go language type,
Package input parses the string data to make it a go language type,
example
cli/optionParse
option parse for cli
option parse for cli
internal
Package logger basic and simple logger for application, it base the go embed `log` package.
Package logger basic and simple logger for application, it base the go embed `log` package.
lgr
Package lgr An instance of library logger, used for direct output from the command line, etc.
Package lgr An instance of library logger, used for direct output from the command line, etc.
Package number handler like unit cover.
Package number handler like unit cover.
parser
xini
Package xini parse ini config files and utils.
Package xini parse ini config files and utils.
Package rock generic based common package processing
Package rock generic based common package processing
constraints
Package constraints The stereotype extension type definition is used for function /type annotations
Package constraints The stereotype extension type definition is used for function /type annotations
Package str string handler method.
Package str string handler method.
Package util implements other tool more, like type cover, type value check.
Package util implements other tool more, like type cover, type value check.
cloud
Package netutil net util, Web related assistant tools
Package netutil net util, Web related assistant tools
fs
Package fs support facilitate for handler file and direction.
Package fs support facilitate for handler file and direction.
tm
Package tm assistant methods related to time reporting
Package tm assistant methods related to time reporting
unit
Package test unit.
Package test unit.
xsql
Package xsql extends for the sql package.
Package xsql extends for the sql package.

Jump to

Keyboard shortcuts

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