cmd

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocTypeMan      = "man"
	DocTypeMarkdown = "markdown"
	DocTypeReST     = "rest"
	DocTypeYaml     = "yaml"
)
View Source
const (
	FileTypeHTML     = "html"
	FileTypeJSON     = "json"
	FileTypeMarkdown = "markdown"
	FileTypePDF      = "pdf"
	FileTypeTOML     = "toml"
	FileTypeYAML     = "yaml"
)
View Source
const (
	ImTypeAudio = "audio"
	ImTypeFile  = "file"
	ImTypeID    = "id"
	ImTypePhoto = "photo"
	ImTypeText  = "text"
	ImTypeVideo = "video"
	ImTypeVoice = "voice"
)

Variables

View Source
var (
	ErrArgNotFound   = errors.New("argument not found")
	ErrConfNotFound  = errors.New("config not found")
	ErrFileNotFound  = errors.New("file not found")
	ErrFileType      = errors.New("file type not correct")
	ErrInitialFailed = errors.New("initial failed")
	ErrInvalidIP     = errors.New("invalid IP")
	ErrInvalidLength = errors.New("invalid length")
	ErrParseCert     = errors.New("can not correctly parse certificate")
	ErrEmptyResponse = errors.New("response is empty")
	ErrTokenNotFound = errors.New("token not found")
)

Functions

func Config added in v0.0.12

func Config(subFn ConfigBlock) error

Get secret token from config.

func Examples added in v0.0.9

func Examples(s string) string

Print examples with color.

func Execute

func Execute()

func OutputDefaultJSON added in v0.0.12

func OutputDefaultJSON(i interface{})

func OutputDefaultNone added in v0.1.0

func OutputDefaultNone(i interface{})

func OutputDefaultString added in v0.0.12

func OutputDefaultString(r rootOutput)

func OutputDefaultYAML added in v0.0.12

func OutputDefaultYAML(i interface{})

func PrintJSON added in v0.0.12

func PrintJSON(i interface{})

func PrintString added in v0.1.0

func PrintString(i interface{})

func PrintYAML added in v0.0.12

func PrintYAML(i interface{})

func ValidDomain added in v0.0.12

func ValidDomain(i interface{}) bool

If i is a domain return true.

func ValidFile added in v0.0.12

func ValidFile(f string) bool

If f is a valid path return true.

func ValidIP added in v0.1.0

func ValidIP(i string) bool

If i is a ipv address return true.

func ValidIPv4 added in v0.1.0

func ValidIPv4(i string) bool

If i is a ipv4 address return true.

func ValidIPv6 added in v0.1.0

func ValidIPv6(i string) bool

If i is a ipv6 address return true.

func ValidURL added in v0.0.12

func ValidURL(u string) bool

If u is a valid url return true.

Types

type ByteSize added in v0.1.0

type ByteSize float64
const (
	KB ByteSize = 1 << (10 * iota)
	MB
	GB
	TB
	PB
	EB
	ZB
	YB
)

func (ByteSize) String added in v0.1.0

func (b ByteSize) String() string

type ConfigBlock added in v0.1.0

type ConfigBlock string
const (
	ConfigBlockICP      ConfigBlock = "icp"
	ConfigBlockLINE     ConfigBlock = "line"
	ConfigBlockSlack    ConfigBlock = "slack"
	ConfigBlockTelegram ConfigBlock = "telegram"
)

type GeoIPBatch added in v0.0.7

type GeoIPBatch []GeoIPSingle

func (GeoIPBatch) Request added in v0.0.10

func (GeoIPBatch) Request(geoipBatch []string) (*GeoIPBatch, error)

type GeoIPSingle added in v0.0.7

type GeoIPSingle struct {
	Continent   string `json:"continent"`
	Country     string `json:"country"`
	CountryCode string `json:"countryCode"`
	RegionName  string `json:"regionName"`
	City        string `json:"city"`
	District    string `json:"district"`
	Timezone    string `json:"timezone"`
	Currency    string `json:"currency"`
	ISP         string `json:"isp"`
	Org         string `json:"org"`
	As          string `json:"as"`
	Asname      string `json:"asname"`
	Mobile      bool   `json:"mobile"`
	Proxy       bool   `json:"proxy"`
	Hosting     bool   `json:"hosting"`
	Query       string `json:"query"`
}

func (GeoIPSingle) Request added in v0.0.10

func (GeoIPSingle) Request(geoipInput string) (*GeoIPSingle, error)

type RandomCharacter added in v0.1.2

type RandomCharacter string
const (
	LowercaseLetters RandomCharacter = "abcdefghijklmnopqrstuvwxyz"
	UppercaseLetters RandomCharacter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Symbols          RandomCharacter = "~!@#$%^&*()_+`-={}|[]\\:\"<>?,./"
	Numbers          RandomCharacter = "0123456789"
	AllSet           RandomCharacter = LowercaseLetters + UppercaseLetters + Symbols + Numbers
)

Jump to

Keyboard shortcuts

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