txt_load

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// file version not change, needn't load the file
	ErrNoNeedUpdate = errors.New("Version no change no need update")
	// line num of file larger than maxline configured
	ErrMaxLineExceed = errors.New("Max line exceed")
	// wrong meta info
	ErrWrongMetaInfo = 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