ips

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdSet   = "set"
	CmdUnset = "unset"
	CmdReset = "reset"
)
View Source
const (
	ConfigName = "ips"
	ConfigType = "json"
	EnvIPSDir  = "IPS_DIR"
)

Variables

View Source
var MagicMap = map[string]string{
	"ipv4":      "ipv4_file",
	"ipv6":      "ipv6_file",
	"ipip":      "city.free.ipdb",
	"qqwry":     "qqwry.dat",
	"zxinc":     "zxipv6wry.db",
	"maxmind":   "GeoLite2-City.mmdb",
	"ip2region": "ip2region.xdb",
	"dbip":      "dbip-city-lite.mmdb",
	"dbip-asn":  "dbip-asn-lite.mmdb",
}
View Source
var (
	Version = "(devel)"
)

Functions

func Config added in v0.1.4

func Config(cmd *cobra.Command, args []string)

func Download

func Download(cmd *cobra.Command, args []string)

func Dump added in v0.2.0

func Dump(cmd *cobra.Command, args []string)

func Execute

func Execute()

Execute is the entry point for the CLI tool. It executes the root command.

func GetConfig added in v0.2.0

func GetConfig() *ips.Config

GetConfig initializes and returns the configuration for the IP service.

func GetFlagConfig added in v0.2.0

func GetFlagConfig() *ips.Config

GetFlagConfig initializes and returns the configuration for the IP service. It loads the configuration from a file or environment variables, then overrides specific fields based on the global variables, which might be set from command-line arguments.

func Pack

func Pack(cmd *cobra.Command, args []string)

func PreRunInit added in v0.2.0

func PreRunInit(cmd *cobra.Command, args []string)

PreRunInit is called before the main Run function. It sets up logging and initializes the IP manager.

func Root

func Root(cmd *cobra.Command, args []string)

Root is the main logic for the IP query command. It also supports pipeline queries.

func Server added in v0.2.5

func Server(cmd *cobra.Command, args []string)

func SetConfig added in v0.2.0

func SetConfig(key string, value string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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