util

package
v0.0.0-...-f2a16fb Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BasicLevel int = 0
View Source
var SupporseRange int = 5

Functions

func DumpResult

func DumpResult(path, spiderName, message string)

os.Getwn() + "/"+path add fileName with message

func GetLocalIp

func GetLocalIp() string

func HashString

func HashString(encode string) uint64

func LoadSettingFromFile

func LoadSettingFromFile(fileName string, setting *Settings)

load json config change 127.0.0.1 to basic ip

func MkdirIfNotExist

func MkdirIfNotExist(path string)

func ScanSpider

func ScanSpider(dir string)

Types

type Index

type Index struct {
	Node  *Node
	Right *Index
	Down  *Index
	Level int
}

func NewIndex

func NewIndex(Node *Node, Down *Index, Level int) *Index

type IntKey

type IntKey struct {
	Key int
}

func NewIntKey

func NewIntKey(key int) *IntKey

func (*IntKey) Compare

func (this *IntKey) Compare(key Key) int8

func (*IntKey) GetNum

func (this *IntKey) GetNum() int

type Key

type Key interface {
	Compare(key Key) int8
	GetNum() int
}

type Node

type Node struct {
	Key   Key
	Value interface{}
	Next  *Node
}

func NewNode

func NewNode(Key Key, Value interface{}) *Node

type Settings

type Settings struct {
	HttpPort         int
	MulticastEnable  bool
	Name             string
	NodeList         []string
	TcpPort          int
	LogPath          string
	ConfigFile       string
	DownloadInterval int
}

settings

func NewSettings

func NewSettings() *Settings

type SkipList

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

func NewSkipList

func NewSkipList() *SkipList

func (*SkipList) Delete

func (this *SkipList) Delete(key Key) *Node

if not exist if head other

func (*SkipList) Get

func (this *SkipList) Get(key Key) *Node

func (*SkipList) Insert

func (this *SkipList) Insert(key Key, Value interface{}) *Node

head is nil key < head key>=head

Jump to

Keyboard shortcuts

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