exchange

package
v0.0.0-...-f1bc7a1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2013 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CrawlerNotFound = errors.New("Crawler Not Found")
)
View Source
var (
	EmptyError = errors.New("No node have been added")
)

Functions

This section is empty.

Types

type ConsistentHash

type ConsistentHash struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewConsistentHash

func NewConsistentHash() *ConsistentHash

func (*ConsistentHash) Add

func (c *ConsistentHash) Add(token string)

func (*ConsistentHash) Get

func (c *ConsistentHash) Get(token string) (string, error)

func (*ConsistentHash) Remove

func (c *ConsistentHash) Remove(token string)

type Crawler

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

func NewCrawler

func NewCrawler(eid exchangeid, conn net.Conn) *Crawler

func (*Crawler) GetConn

func (c *Crawler) GetConn() net.Conn

func (*Crawler) GetExchangeId

func (c *Crawler) GetExchangeId() exchangeid

func (*Crawler) GetId

func (c *Crawler) GetId() string

type Exchange

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

func NewExchange

func NewExchange(id string, socket net.Listener) *Exchange

func (*Exchange) Start

func (e *Exchange) Start(quit <-chan bool, quitted chan<- bool)

type Router

type Router struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) Add

func (r *Router) Add(c *Crawler)

func (*Router) Remove

func (r *Router) Remove(c *Crawler)

func (*Router) Route

func (r *Router) Route(rawurl string) (c *Crawler, err error)

Jump to

Keyboard shortcuts

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