cmd

package
v0.14.11 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 83 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"
	CommandPs         = "ps"
	CommandQrcode     = "qrcode"
	CommandRandom     = "random"
	CommandRead       = "read"
	CommandReadlink   = "readlink"
	CommandRedis      = "redis"
	CommandReST       = "rest"
	CommandSign       = "sign"
	CommandSlack      = "slack"
	CommandSs         = "ss"
	CommandSSH        = "ssh-keygen"
	CommandSSL        = "ssl"
	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 = "  "

	NotImplemented = "not implemented on " + PlatformS
	PlatformS      = runtime.GOOS + "/" + runtime.GOARCH
	PlatformU      = runtime.GOOS + "_" + runtime.GOARCH

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

Variables

This section is empty.

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 ParseInterfaces added in v0.3.0

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

func ReadConfig added in v0.7.2

func ReadConfig(block string, flag any) error

func Run added in v0.14.10

func Run() *cobra.Command

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)

type Df added in v0.14.4

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.14.4

func (d Df) OutputData() []string

func (*Df) ParseDevices added in v0.14.4

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

func (Df) String added in v0.14.4

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{}

func (*FileStat) FileType added in v0.4.0

func (*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(inputs []string) ([]GeoIP, 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 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 Ps added in v0.14.4

type Ps struct {
	Process *process.Process
}

func (*Ps) CPUGuestNiceTime added in v0.14.4

func (p *Ps) CPUGuestNiceTime() string

func (*Ps) CPUGuestTime added in v0.14.4

func (p *Ps) CPUGuestTime() string

func (*Ps) CPUIdleTime added in v0.14.4

func (p *Ps) CPUIdleTime() string

func (*Ps) CPUIowaitTime added in v0.14.4

func (p *Ps) CPUIowaitTime() string

func (*Ps) CPUIrqTime added in v0.14.4

func (p *Ps) CPUIrqTime() string

func (*Ps) CPUNiceTime added in v0.14.4

func (p *Ps) CPUNiceTime() string

func (*Ps) CPUPercent added in v0.14.4

func (p *Ps) CPUPercent() string

func (*Ps) CPUSoftirqTime added in v0.14.4

func (p *Ps) CPUSoftirqTime() string

func (*Ps) CPUStealTime added in v0.14.4

func (p *Ps) CPUStealTime() string

func (*Ps) CPUSystemTime added in v0.14.4

func (p *Ps) CPUSystemTime() string

func (*Ps) CPUUserTime added in v0.14.4

func (p *Ps) CPUUserTime() string

func (*Ps) CreateTime added in v0.14.4

func (p *Ps) CreateTime() string

func (*Ps) Data added in v0.14.4

func (p *Ps) Data() string

func (*Ps) Exe added in v0.14.4

func (p *Ps) Exe(b bool) string

func (*Ps) HWM added in v0.14.4

func (p *Ps) HWM() string

func (*Ps) Locked added in v0.14.4

func (p *Ps) Locked() string

func (*Ps) MemPercent added in v0.14.4

func (p *Ps) MemPercent() string

func (*Ps) Nice added in v0.14.4

func (p *Ps) Nice() string

func (*Ps) Pid added in v0.14.4

func (p *Ps) Pid() string

func (*Ps) Ppid added in v0.14.4

func (p *Ps) Ppid() string

func (*Ps) ProcessName added in v0.14.4

func (p *Ps) ProcessName() string

func (*Ps) RSS added in v0.14.4

func (p *Ps) RSS() string

func (*Ps) Stack added in v0.14.4

func (p *Ps) Stack() string

func (*Ps) Status added in v0.14.4

func (p *Ps) Status() string

func (*Ps) String added in v0.14.4

func (*Ps) String(header []string, data [][]string)

func (*Ps) Swap added in v0.14.4

func (p *Ps) Swap() string

func (*Ps) Thread added in v0.14.4

func (p *Ps) Thread() string

func (*Ps) Username added in v0.14.4

func (p *Ps) Username() string

func (*Ps) VMS added in v0.14.4

func (p *Ps) VMS() string

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 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 SSL added in v0.14.7

type SSL struct{}

func (*SSL) Generate added in v0.14.7

func (s *SSL) Generate() error

func (*SSL) Sign added in v0.14.7

func (s *SSL) Sign(caCert, caKey string) error

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 Ss added in v0.14.4

type Ss struct{}

func (*Ss) GetData added in v0.14.4

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

func (*Ss) String added in v0.14.4

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

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 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 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() 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() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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