cmd

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 81 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandArping     = "arping"
	CommandAudio      = "audio"
	CommandBase32     = "base32"
	CommandBase64     = "base64"
	CommandBase32Hex  = CommandBase32 + CommandHex
	CommandBase32Std  = CommandBase32 + "std"
	CommandBase64Std  = CommandBase64 + "std"
	CommandBase64URL  = CommandBase64 + "url"
	CommandBootstrap  = "bootstrap-token"
	CommandCalculate  = "calculate"
	CommandCert       = "cert"
	CommandConvert    = "convert"
	CommandCPU        = "cpu"
	CommandCsv        = "csv"
	CommandCsv2JSON   = CommandCsv + "2" + CommandJSON
	CommandCsv2Toml   = CommandCsv + "2" + CommandToml
	CommandCsv2XML    = CommandCsv + "2" + CommandXML
	CommandCsv2Yaml   = CommandCsv + "2" + CommandYaml
	CommandDate       = "date"
	CommandDf         = "df"
	CommandDig        = "dig"
	CommandDiscord    = "Discord"
	CommandDisk       = "disk"
	CommandDoc        = "doc"
	CommandDos2Unix   = "dos2unix"
	CommandEncode     = "encode"
	CommandEncrypt    = "encrypt"
	CommandFile       = "file"
	CommandFree       = "free"
	CommandGenerate   = "generate"
	CommandGeoip      = "geoip"
	CommandHash       = "hash"
	CommandHex        = "hex"
	CommandHost       = "host"
	CommandIcp        = "icp"
	CommandID         = "id"
	CommandIP         = "ip"
	CommandJSON       = "json"
	CommandJSON2Csv   = CommandJSON + "2" + CommandCsv
	CommandJSON2Toml  = CommandJSON + "2" + CommandToml
	CommandJSON2XML   = CommandJSON + "2" + CommandXML
	CommandJSON2Yaml  = CommandJSON + "2" + CommandYaml
	CommandLINE       = "LINE"
	CommandLoad       = "load"
	CommandLowercase  = "lowercase"
	CommandMan        = "man"
	CommandMarkdown   = "markdown"
	CommandMemory     = "memory"
	CommandMtr        = "mtr"
	CommandNetmask    = "netmask"
	CommandNetwork    = "network"
	CommandNumber     = "number"
	CommandOtp        = "otp"
	CommandPhoto      = "photo"
	CommandPing       = "ping"
	CommandQrcode     = "qrcode"
	CommandRandom     = "random"
	CommandRead       = "read"
	CommandReadlink   = "readlink"
	CommandRedis      = "redis"
	CommandReST       = "rest"
	CommandSign       = "sign"
	CommandSlack      = "Slack"
	CommandSs         = "ss"
	CommandSSH        = "ssh-keygen"
	CommandStat       = "stat"
	CommandString     = "string"
	CommandSymbol     = "symbol"
	CommandSystem     = "system"
	CommandTcping     = "tcping"
	CommandTelegram   = "Telegram"
	CommandText       = "text"
	CommandToml       = "toml"
	CommandToml2Csv   = CommandToml + "2" + CommandCsv
	CommandToml2JSON  = CommandToml + "2" + CommandJSON
	CommandToml2XML   = CommandToml + "2" + CommandXML
	CommandToml2Yaml  = CommandToml + "2" + CommandYaml
	CommandTraceroute = "traceroute"
	CommandTree       = "tree"
	CommandUpdate     = "update"
	CommandUppercase  = "uppercase"
	CommandURL        = "url"
	CommandVersion    = "version"
	CommandVideo      = "video"
	CommandVoice      = "voice"
	CommandWhois      = "whois"
	CommandWiFi       = "wifi"
	CommandWsping     = "wsping"
	CommandXML        = "xml"
	CommandXML2Csv    = CommandXML + "2" + CommandCsv
	CommandXML2JSON   = CommandXML + "2" + CommandJSON
	CommandXML2Toml   = CommandXML + "2" + CommandToml
	CommandXML2Yaml   = CommandXML + "2" + CommandYaml
	CommandYaml       = "yaml"
	CommandYaml2Csv   = CommandYaml + "2" + CommandCsv
	CommandYaml2JSON  = CommandYaml + "2" + CommandJSON
	CommandYaml2Toml  = CommandYaml + "2" + CommandToml
	CommandYaml2XML   = CommandYaml + "2" + CommandXML
)
View Source
const (
	EncryptModeCFB = "CFB"
	EncryptModeCTR = "CTR"
	EncryptModeGCM = "GCM"
	EncryptModeOFB = "OFB"
)
View Source
const (
	FileModeROwner fs.FileMode = 0600
	FileModeRAll   fs.FileMode = 0644
)
View Source
const (
	HashMd5        = "md5"
	HashSha1       = "sha1"
	HashSha224     = "sha224"
	HashSha256     = "sha256"
	HashSha384     = "sha384"
	HashSha512     = "sha512"
	HashSha512_224 = "sha512_224"
	HashSha512_256 = "sha512_256"
)
View Source
const (
	TypeBinary  = "binary"
	TypeOctal   = "octal"
	TypeDecimal = "decimal"
	TypeHex     = "hex"
	TypeCisco   = "cisco"
)
View Source
const (
	IndentTwoSpaces = "  "

	TCP  = "tcp"
	TCP6 = "tcp6"
	UDP  = "udp"
	UDP6 = "udp6"
	All  = "all"
	IPv4 = "ipv4"
	IPv6 = "ipv6"
)

Variables

View Source
var RootCmd = root()

Functions

func HashAlgorithm added in v0.1.4

func HashAlgorithm(alg string) hash.Hash

func NewRepository added in v0.2.0

func NewRepository(username, repo string) *repository

func OutputDefaultJSON added in v0.0.12

func OutputDefaultJSON(i any)

func OutputDefaultNone added in v0.1.0

func OutputDefaultNone(i any)

func OutputDefaultString added in v0.0.12

func OutputDefaultString(i any)

func OutputDefaultYAML added in v0.0.12

func OutputDefaultYAML(i any)

func OutputInterfaceString added in v0.1.3

func OutputInterfaceString(r OutputFormat)

func ParseInterfaces added in v0.3.0

func ParseInterfaces(iface net.InterfaceStatList, counters []net.IOCountersStat) (map[string]int, map[int]string)

func PrintJSON added in v0.0.12

func PrintJSON(i any)

func PrintString added in v0.1.0

func PrintString(i any)

func PrintTable added in v0.8.0

func PrintTable(header []string, data [][]string, align int, padding string, format bool)

func PrintYAML added in v0.0.12

func PrintYAML(i any)

func ReadConfig added in v0.7.2

func ReadConfig(block string, flag any) error

Types

type Cert added in v0.11.5

type Cert struct {
	ExpiryTime string   `json:"expiryTime,omitempty" yaml:"expiryTime,omitempty"`
	Days       int      `json:"days,omitempty" yaml:"days,omitempty"`
	Issuer     string   `json:"issuer,omitempty" yaml:"issuer,omitempty"`
	ServerIP   string   `json:"serverIp,omitempty" yaml:"serverIp,omitempty"`
	DNS        []string `json:"dns,omitempty" yaml:"dns,omitempty"`
}

func (*Cert) CheckFile added in v0.11.5

func (c *Cert) CheckFile(fileName string) (*Cert, error)

func (*Cert) CheckHost added in v0.11.5

func (c *Cert) CheckHost(host string) (*Cert, error)

func (*Cert) Generate added in v0.13.4

func (c *Cert) Generate() error

func (*Cert) Sign added in v0.13.4

func (c *Cert) Sign(caCert, caKey string) error

type DF added in v0.11.5

type DF struct {
	Filesystem  string `json:"Filesystem"`
	Size        string `json:"Size"`
	Used        string `json:"Used"`
	Avail       string `json:"Avail"`
	UsedPercent string `json:"Use%"`
	MountedOn   string `json:"Mounted on"`
	Fstype      string `json:"FsType"`
	// Opts        []string `json:"Opts"`
	// InodesSize        uint64 `json:"iSize"`
	InodesUsed        string `json:"iUsed"`
	InodesFree        string `json:"iFree"`
	InodesUsedPercent string `json:"iUse%"`
}

func (DF) OutputData added in v0.11.5

func (d DF) OutputData() []string

func (*DF) ParseDevices added in v0.11.5

func (d *DF) ParseDevices(usage *disk.UsageStat, partition []disk.PartitionStat)

func (DF) String added in v0.11.5

func (d DF) String(value any)

type Dig added in v0.11.6

type Dig struct {
	NAME   string `json:"name" yaml:"name"`
	TTL    string `json:"ttl" yaml:"ttl"`
	CLASS  string `json:"class" yaml:"class"`
	TYPE   string `json:"type" yaml:"type"`
	RECORD string `json:"record" yaml:"record"`
}

type DigList added in v0.11.6

type DigList []Dig

func (*DigList) GetLocalServer added in v0.11.6

func (d *DigList) GetLocalServer() (string, error)

func (*DigList) Request added in v0.11.6

func (d *DigList) Request(digType uint16, domain, network, server string) (DigList, error)

func (DigList) String added in v0.11.6

func (d DigList) String()

type Discord added in v0.11.6

type Discord struct {
	API      *discordgo.Session
	Response *discordgo.Message
}

func (*Discord) File added in v0.11.6

func (d *Discord) File(channel, arg string) error

func (*Discord) Init added in v0.11.6

func (d *Discord) Init(token string) error

func (*Discord) Text added in v0.11.6

func (d *Discord) Text(channel, arg string) error

func (*Discord) TextTTS added in v0.11.6

func (d *Discord) TextTTS(channel, arg string) error

type Encode added in v0.11.5

type Encode struct{}
var Encoder Encode

func (*Encode) Base32HexDecode added in v0.11.5

func (*Encode) Base32HexDecode(s string) ([]byte, error)

func (*Encode) Base32HexEncode added in v0.11.5

func (*Encode) Base32HexEncode(i any) (string, error)

func (*Encode) Base32StdDecode added in v0.11.5

func (*Encode) Base32StdDecode(s string) ([]byte, error)

func (*Encode) Base32StdEncode added in v0.11.5

func (*Encode) Base32StdEncode(i any) (string, error)

func (*Encode) Base64StdDecode added in v0.11.5

func (*Encode) Base64StdDecode(s string) ([]byte, error)

func (*Encode) Base64StdEncode added in v0.11.5

func (*Encode) Base64StdEncode(i any) (string, error)

func (*Encode) Base64URLDecode added in v0.11.5

func (*Encode) Base64URLDecode(s string) ([]byte, error)

func (*Encode) Base64URLEncode added in v0.11.5

func (*Encode) Base64URLEncode(i any) (string, error)

func (*Encode) HexDecode added in v0.11.5

func (*Encode) HexDecode(s string) ([]byte, error)

func (*Encode) HexEncode added in v0.11.5

func (*Encode) HexEncode(i any) (string, error)

func (*Encode) JSONDecode added in v0.11.5

func (*Encode) JSONDecode(r io.Reader, i any) (any, error)

func (*Encode) JSONEncode added in v0.11.5

func (*Encode) JSONEncode(i any) (string, error)

func (*Encode) JSONMarshaler added in v0.11.5

func (*Encode) JSONMarshaler(src, dst any) error

func (*Encode) PemDecode added in v0.11.5

func (*Encode) PemDecode(b []byte) ([]byte, error)

func (*Encode) PemEncode added in v0.11.5

func (*Encode) PemEncode(i any, t ...string) (string, error)

func (*Encode) XMLDecode added in v0.11.5

func (*Encode) XMLDecode(r io.Reader, i any) (any, error)

func (*Encode) XMLEncode added in v0.11.5

func (*Encode) XMLEncode(i any) (string, error)

func (*Encode) YamlDecode added in v0.11.5

func (*Encode) YamlDecode(r io.Reader, i any) (any, error)

func (*Encode) YamlEncode added in v0.11.5

func (*Encode) YamlEncode(i any) (string, error)

type Encrypt added in v0.11.5

type Encrypt struct{}
var Encryptor Encrypt

func (*Encrypt) CheckSecret added in v0.11.5

func (*Encrypt) CheckSecret(secret string) []byte

func (*Encrypt) DecryptFile added in v0.11.5

func (e *Encrypt) DecryptFile(secret, filename, mode string) error

func (*Encrypt) DecryptString added in v0.11.5

func (e *Encrypt) DecryptString(secret, text, mode string) (string, error)

func (*Encrypt) EncryptFile added in v0.11.5

func (e *Encrypt) EncryptFile(secret, filename, mode string) error

func (*Encrypt) EncryptString added in v0.11.5

func (e *Encrypt) EncryptString(secret, text, mode string) (string, error)

func (*Encrypt) GetKey added in v0.11.5

func (e *Encrypt) GetKey(secret, filename string, perm os.FileMode) []byte

type FileStat added in v0.4.0

type FileStat struct {
	Dev           int32    `json:"Dev"`
	Mode          uint16   `json:"Mode"`
	Nlink         uint16   `json:"Nlink"`
	Ino           uint64   `json:"Ino"`
	UID           uint32   `json:"Uid"`
	GID           uint32   `json:"Gid"`
	Rdev          int32    `json:"Rdev"`
	PadCgo0       [4]byte  `json:"Pad_cgo_0"`
	Atimespec     Timespec `json:"Atimespec"`
	Mtimespec     Timespec `json:"Mtimespec"`
	Ctimespec     Timespec `json:"Ctimespec"`
	Birthtimespec Timespec `json:"Birthtimespec"`
	Size          int64    `json:"Size"`
	Blocks        int64    `json:"Blocks"`
	Blksize       int32    `json:"Blksize"`
	Flags         uint32   `json:"Flags"`
	Gen           uint32   `json:"Gen"`
	Lspare        int32    `json:"Lspare"`
	Qspare        [2]int64 `json:"Qspare"`
}

func (*FileStat) FileType added in v0.4.0

func (f *FileStat) FileType(stat fs.FileInfo) string

func (*FileStat) String added in v0.4.0

func (f *FileStat) String(path string) error

type Free added in v0.11.5

type Free struct{}

func (*Free) Output added in v0.11.5

func (f *Free) Output() error

func (Free) String added in v0.11.5

func (Free) String(header []string, data [][]string)

type GeoIP added in v0.11.5

type GeoIP 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 (GeoIP) Request added in v0.11.5

func (GeoIP) Request(ip string) (*GeoIP, error)

type GeoIPList added in v0.11.6

type GeoIPList []GeoIP

func (GeoIPList) Request added in v0.11.6

func (GeoIPList) Request(inputs []string) (*GeoIPList, error)

type Hash added in v0.11.5

type Hash struct{}
var Hasher Hash

func (*Hash) CheckFile added in v0.11.5

func (h *Hash) CheckFile(filename string)

func (*Hash) Hash added in v0.11.5

func (h *Hash) Hash(hasher hash.Hash, i any) (string, error)

func (*Hash) ListAll added in v0.11.5

func (h *Hash) ListAll(s string)

func (*Hash) WriteFile added in v0.11.5

func (h *Hash) WriteFile(hasher hash.Hash, filename string) (string, error)

type ICMPStat added in v0.11.7

type ICMPStat struct {
	Lost bool

	Hop   int
	DstIP string

	Send, Loss, Receive int
	Min, Avg, Max       time.Duration
	Rtts                []time.Duration
}

type ICP added in v0.11.5

type ICP struct {
	DomainName string `json:"domain,omitempty" yaml:"domain,omitempty"`
	ICPCode    string `json:"icp,omitempty" yaml:"icp,omitempty"`
	ICPStatus  string `json:"icpstatus,omitempty" yaml:"icpstatus,omitempty"`
}

func (*ICP) Request added in v0.11.5

func (i *ICP) Request(account, key, domain string) error

type LINE added in v0.11.6

type LINE struct {
	API      *linebot.Client
	Response *linebot.BasicResponse
}

func (*LINE) GetID added in v0.11.6

func (l *LINE) GetID()

func (*LINE) Init added in v0.11.6

func (l *LINE) Init(secret, token string) error

type MTR added in v0.12.0

type MTR struct {
	IPv6           bool
	LocalHostname  string
	RemoteHostname string
	TerminalWidth  int
	Statistics     [][]string
	// contains filtered or unexported fields
}

func (*MTR) Run added in v0.12.0

func (m *MTR) Run(ctx context.Context) error

func (*MTR) Summary added in v0.12.0

func (m *MTR) Summary()

type Netmask added in v0.11.5

type Netmask struct{}

func (*Netmask) Address added in v0.11.5

func (n *Netmask) Address(arg, typ string) error

func (*Netmask) CIDR added in v0.11.5

func (n *Netmask) CIDR(a, b, typ string) error

func (*Netmask) Range added in v0.11.5

func (n *Netmask) Range(arg string) error

type OTP added in v0.11.5

type OTP struct {
	Period    int8
	Digit     int8
	Algorithm string
}

func (*OTP) GenSecret added in v0.11.5

func (o *OTP) GenSecret() (string, error)

func (*OTP) HOTP added in v0.11.5

func (o *OTP) HOTP(secret string, timeInterval int64) (string, error)

func (*OTP) SetAlgorithm added in v0.11.5

func (o *OTP) SetAlgorithm() func() hash.Hash

func (*OTP) SetDigits added in v0.11.5

func (o *OTP) SetDigits() [2]int

func (*OTP) SetTimeInterval added in v0.11.5

func (o *OTP) SetTimeInterval() int64

func (*OTP) TOTP added in v0.11.5

func (o *OTP) TOTP(secret string) (string, error)

func (*OTP) Verify added in v0.11.5

func (o *OTP) Verify(input, secret string) (bool, error)

type OutputFormat added in v0.1.6

type OutputFormat interface {
	String()
}

type Ping added in v0.11.6

type Ping struct {
	IPv6              bool
	Count, Size, TTL  int
	Interval, Timeout time.Duration
	Data              icmp.Message
	Conn              *icmp.PacketConn
	// contains filtered or unexported fields
}

func (*Ping) Connect added in v0.11.6

func (p *Ping) Connect(c context.Context, host string)

func (*Ping) Listen added in v0.11.6

func (p *Ping) Listen() (*icmp.PacketConn, error)

type Random added in v0.11.5

type Random []byte
var Randoms Random

func (Random) GenerateAll added in v0.11.5

func (r Random) GenerateAll(length, minLower, minUpper, minSymbol, minNumber int) Random

func (Random) GenerateString added in v0.11.5

func (Random) GenerateString(length int, charSet RandomCharacter) Random

func (Random) Rand added in v0.11.5

func (Random) Rand(length int) []byte

func (Random) String added in v0.11.5

func (r Random) String() string

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
)

type Redis added in v0.11.5

type Redis struct{}

func (*Redis) Connection added in v0.11.5

func (r *Redis) Connection(host, port, user, pass string, db int) *redis.Client

func (*Redis) Do added in v0.11.5

func (r *Redis) Do(rdb *redis.Client, commands []string) error

type SS added in v0.14.0

type SS struct{}

func (*SS) GetData added in v0.14.0

func (s *SS) GetData(inet, proto string, fn netstat.AcceptFn) [][]string

func (*SS) String added in v0.14.0

func (*SS) String(data [][]string)

type SSHKeygen added in v0.11.5

type SSHKeygen struct{}

func (*SSHKeygen) Generate added in v0.11.5

func (r *SSHKeygen) Generate(bit int, path string) error

func (*SSHKeygen) GetPub added in v0.13.3

func (*SSHKeygen) GetPub(keyFile string) error

func (*SSHKeygen) Prepare added in v0.11.5

func (*SSHKeygen) Prepare(path string) (string, string)

Prepare checks file exist or not, and return files name.

type Slack added in v0.11.6

type Slack struct {
	API *slack.Client
}

func (*Slack) Init added in v0.11.6

func (s *Slack) Init(token string) error

func (*Slack) Photo added in v0.11.6

func (s *Slack) Photo(channel, arg string) error

func (*Slack) Text added in v0.11.6

func (s *Slack) Text(channel, arg string) error

type System added in v0.11.6

type System struct{}

func (*System) CPUInfo added in v0.11.6

func (s *System) CPUInfo() (any, error)

func (*System) DiskUsage added in v0.11.6

func (s *System) DiskUsage() (any, error)

func (*System) HostInfo added in v0.11.6

func (s *System) HostInfo() (any, error)

func (*System) LoadAvg added in v0.11.6

func (s *System) LoadAvg() (any, error)

func (*System) MemUsage added in v0.11.6

func (s *System) MemUsage() (any, error)

func (*System) NetInfo added in v0.11.6

func (s *System) NetInfo() (any, error)

type TCPing added in v0.11.5

type TCPing struct {
	Protocal string
	Timeout  time.Duration
}

func (*TCPing) Connect added in v0.11.5

func (t *TCPing) Connect(counter int, args []string) (string, time.Duration, error)

type Telegram added in v0.11.6

type Telegram struct {
	API      *tgBot.BotAPI
	Response tgBot.Message
}

func (Telegram) Animation added in v0.11.6

func (t Telegram) Animation(chat int64, arg, caption string) error

func (*Telegram) Audio added in v0.11.6

func (t *Telegram) Audio(chat int64, arg, caption string) error

func (Telegram) ChatDescription added in v0.11.6

func (t Telegram) ChatDescription(chat int64, arg string) error

func (Telegram) ChatPhoto added in v0.11.6

func (t Telegram) ChatPhoto(chat int64, arg string) error

func (Telegram) ChatTitle added in v0.11.6

func (t Telegram) ChatTitle(chat int64, arg string) error

func (Telegram) Dice added in v0.11.6

func (t Telegram) Dice(chat int64) error

func (*Telegram) File added in v0.11.6

func (t *Telegram) File(chat int64, arg, caption string) error

func (*Telegram) GetUpdate added in v0.11.6

func (t *Telegram) GetUpdate()

func (*Telegram) Init added in v0.11.6

func (t *Telegram) Init(token string) error

func (*Telegram) Photo added in v0.11.6

func (t *Telegram) Photo(chat int64, arg, caption string) error

func (*Telegram) Text added in v0.11.6

func (t *Telegram) Text(chat int64, arg string) error

func (*Telegram) Video added in v0.11.6

func (t *Telegram) Video(chat int64, arg, caption string) error

func (*Telegram) Voice added in v0.11.6

func (t *Telegram) Voice(chat int64, arg, caption string) error

type Timespec added in v0.4.0

type Timespec struct {
	SEC  int64 `json:"Sec"`
	Nsec int64 `json:"Nsec"`
}

type Traceroute added in v0.11.5

type Traceroute struct {
	Size, TTL, Retry  int
	Interval, Timeout time.Duration
	Connetion         *icmp.PacketConn
	Data              icmp.Message

	Host   string
	Target *net.IPAddr

	Count int

	Record bool
	Stat   []ICMPStat
	// contains filtered or unexported fields
}

func (*Traceroute) Connect added in v0.11.5

func (t *Traceroute) Connect(ctx context.Context, reply []byte) error

func (*Traceroute) Listen added in v0.11.7

func (*Traceroute) Listen() (*icmp.PacketConn, error)

type Tree added in v0.11.6

type Tree struct {
	Type     string  `json:"type"`
	Path     string  `json:"path"`
	Name     string  `json:"name"`
	Perm     string  `json:"perm"`
	Mode     string  `json:"mode"`
	Links    uint16  `json:"links"`
	UID      string  `json:"uid"`
	GID      string  `json:"gid"`
	Size     string  `json:"size"`
	ModTime  string  `json:"modTime"`
	Inode    string  `json:"inode"`
	Devide   string  `json:"device"`
	Contents *[]Tree `json:"contents"`
	// contains filtered or unexported fields
}

func (*Tree) Walk added in v0.11.6

func (t *Tree) Walk(args []string, opt *TreeOptions)

type TreeOptions added in v0.11.6

type TreeOptions struct {
	All    bool
	Change bool
	Dirs   bool
	Full   bool
	Limit  int
	Perm   bool
	Mode   bool
	Size   bool
	UID    bool
	GID    bool
	Inodes bool
	Device bool
	Links  bool
}

type Updater added in v0.2.0

type Updater struct {
	Upgrade        bool
	ExecutablePath string
	Repository     *repository
}

func NewUpdater added in v0.2.0

func NewUpdater(username, repo, tag string) *Updater

func (*Updater) Download added in v0.2.0

func (u *Updater) Download() error

Fetch the release file.

func (*Updater) Rename added in v0.2.0

func (u *Updater) Rename() error

Decompress, replace original file, and remove compress files ...etc.

type Version added in v0.2.0

type Version struct {
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	Commit  string `json:"commit,omitempty" yaml:"commit,omitempty"`
	Date    string `json:"date,omitempty" yaml:"date,omitempty"`
	Runtime string `json:"runtime,omitempty" yaml:"runtime,omitempty"`
}

func (Version) String added in v0.11.6

func (r Version) String()

type Whois added in v0.11.6

type Whois struct {
	Registrar   string   `json:"registrar" yaml:"registrar"`
	CreatedDate string   `json:"createdDate" yaml:"createdDate"`
	ExpiresDate string   `json:"expiresDate" yaml:"expiresDate"`
	UpdatedDate string   `json:"updatedDate" yaml:"updatedDate"`
	RemainDays  int      `json:"remainDays" yaml:"remainDays"`
	NameServers []string `json:"nameServers" yaml:"nameServers"`
}

func (*Whois) CalculateDays added in v0.11.6

func (w *Whois) CalculateDays(t string) (int, error)

Convert time to days.

func (*Whois) ParseTime added in v0.11.6

func (w *Whois) ParseTime(t string) (string, error)

Convert time to RFC3339 format.

func (*Whois) Request added in v0.11.6

func (w *Whois) Request(domain string) error

func (Whois) String added in v0.11.6

func (w Whois) String()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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