cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "ipd 1.2.3.4",
	Short: "ipd",
	Long:  `ipd`,
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) < 1 {
			return errors.New("Requires IP address")
		}

		return nil
	},
	Run: func(cmd *cobra.Command, args []string) {
		ipAddr := args[0]
		l, err := cfg.Db.Find(ipAddr)
		if err != nil {
			fmt.Printf("IP find error: %s\n", err)
			return
		}
		fmt.Printf("%#v", l)
	},
}

Functions

func Execute

func Execute()

func IpHandler

func IpHandler(w http.ResponseWriter, r *http.Request)

func LoadDb

func LoadDb() (*ip.Db, error)

Types

type Config

type Config struct {
	Db *ip.Db
}

Jump to

Keyboard shortcuts

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