Documentation
¶
Index ¶
- Constants
- Variables
- func Config(cmd *cobra.Command, args []string)
- func Download(cmd *cobra.Command, args []string)
- func Dump(cmd *cobra.Command, args []string)
- func Execute()
- func GetConfig() *ips.Config
- func GetFlagConfig() *ips.Config
- func Pack(cmd *cobra.Command, args []string)
- func PreRunInit(cmd *cobra.Command, args []string)
- func Root(cmd *cobra.Command, args []string)
- func Server(cmd *cobra.Command, args []string)
- func SetConfig(key string, value string)
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 Execute ¶
func Execute()
Execute is the entry point for the CLI tool. It executes the root command.
func GetConfig ¶ added in v0.2.0
GetConfig initializes and returns the configuration for the IP service.
func GetFlagConfig ¶ added in v0.2.0
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 PreRunInit ¶ added in v0.2.0
PreRunInit is called before the main Run function. It sets up logging and initializes the IP manager.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.