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 MyIP(cmd *cobra.Command, args []string)
- func Pack(cmd *cobra.Command, args []string)
- func PreRunInit(cmd *cobra.Command, args []string)
- func Root(cmd *cobra.Command, args []string)
- func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)
- 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" )
View Source
const ( UsageLogLevel = "Set the desired verbosity level for logging." UsageLang = "Language for output data. (default \"zh-CN\")" UsageFields = "Fields to include in the output, separated by commas. (default \"country,province,city,isp\")" UsageUseDBFields = "Use field names as they appear in the database. Default is common field names." UsageRewriteFiles = "Paths to files containing data rewrite rules, separated by commas." UsageDPFields = "Fields to extract from the database. Defaults to all available fields." UsageQueryFile = "Path to the combined IPv4/IPv6 database file." UsageQueryFormat = "The format of the IPv4/IPv6 database file." UsageQueryIPv4File = "Path to the IPv4 database file." UsageQueryIPv4Format = "The format of the IPv4 database file." UsageQueryIPv6File = "Path to the IPv6 database file." UsageQueryIPv6Format = "The format of the IPv6 database file." UsageDPInputFile = "Path to the input IP database file (required)." UsageDPInputFormat = "The format of the input IP database file." UsageDumpOutputFile = "Destination path for the dumped data. Defaults to standard output if not specified." UsagePackOutputFile = "Path to the output IP database file (required)." UsagePackOutputFormat = "The format for the output IP database file." UsageReaderOption = "Additional options for the database reader, if applicable." UsageWriterOption = "Additional options for the database writer, if applicable." UsageHybridMode = "Sets mode for multi-IP source handling; 'comparison' to compare, 'aggregation' to merge data." UsageTextFormat = "Specify the desired format for text output. (default \"%origin [%values]\")" UsageTextValuesSep = "Specify the separator for values in text output. (default \" \")" UsageJson = "Output the results in JSON format." UsageJsonIndent = "Output the results in indent JSON format." UsageAlfred = "Output the results in Alfred format." )
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.