Documentation
¶
Index ¶
Constants ¶
const ( DBFormat = "plain" DBExt = ".txt" MetaPrefix = "# Meta: " FieldSep = "," FieldData = "text" )
Variables ¶
This section is empty.
Functions ¶
func Load ¶ added in v0.2.3
Load opens the specified file, reads its contents, and initializes an IP database. The function first extracts meta information from the file, then parses the IP data, and finally creates an IP database based on the parsed data. FIXME: The plain database format reader has not been implemented yet, so I made a wrap in ipdb format.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a structure that provides functionalities to read from Plain Text.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer provides functionalities to write IP data into plain text format.
func NewWriter ¶
NewWriter initializes a new Writer instance for writing IP data in plain text format. If the io.Writer is not nil, it will directly write data into it.
type WriterOption ¶
WriterOption provides options for the Writer.