mirror of
https://gitlab.durp.info/durfy/apps/durpcli.git
synced 2026-05-07 07:50:35 -05:00
update durpcli
This commit is contained in:
parent
f13224733f
commit
ca21cb9811
18 changed files with 193 additions and 157 deletions
|
|
@ -1,14 +1,9 @@
|
|||
/*
|
||||
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
|
||||
|
||||
*/
|
||||
package net
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// NetCmd represents the net command
|
||||
var NetCmd = &cobra.Command{
|
||||
Use: "net",
|
||||
Short: "Net is a palette that contains network based commands",
|
||||
|
|
@ -20,13 +15,4 @@ var NetCmd = &cobra.Command{
|
|||
|
||||
func init() {
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// netCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// netCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
/*
|
||||
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
|
||||
|
||||
*/
|
||||
package net
|
||||
|
||||
import (
|
||||
|
|
@ -14,8 +10,7 @@ import (
|
|||
|
||||
var (
|
||||
urlPath string
|
||||
// Logic
|
||||
client = http.Client{
|
||||
client = http.Client{
|
||||
Timeout: time.Second * 2,
|
||||
}
|
||||
)
|
||||
|
|
@ -34,7 +29,6 @@ func ping(domain string) (int, error) {
|
|||
return resp.StatusCode, nil
|
||||
}
|
||||
|
||||
// pingCmd represents the ping command
|
||||
var pingCmd = &cobra.Command{
|
||||
Use: "ping",
|
||||
Short: "This pings a remote URL and returns the response",
|
||||
|
|
@ -57,13 +51,5 @@ func init() {
|
|||
fmt.Println(err)
|
||||
}
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
NetCmd.AddCommand(pingCmd)
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// pingCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// pingCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue