txt_load

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// file version not change, needn't load the file
	ERR_NO_NEED_UPDATE = errors.New("Version no change no need update")
	// line num of file larger than maxline configured
	ERR_MAX_LINE_EXCEED = errors.New("Max line exceed")
	// wrong meta info
	ERR_WRONG_META_INFO = errors.New("Wrong meta info")
)

Functions

This section is empty.

Types

type MetaInfo

type MetaInfo struct {
	Version     string
	SingleIPNum int // single IP num
	PairIPNum   int // Pair IP num
}

type TxtFileLoader

type TxtFileLoader struct {
	// contains filtered or unexported fields
}

func NewTxtFileLoader

func NewTxtFileLoader(fileName string) *TxtFileLoader

func (TxtFileLoader) CheckAndLoad

func (f TxtFileLoader) CheckAndLoad(curVersion string) (*ipdict.IPItems, error)

check Version num and load IP txt file to IP items in memory

func (*TxtFileLoader) SetMaxLine

func (f *TxtFileLoader) SetMaxLine(maxLine int)

set max line num

Jump to

Keyboard shortcuts

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