queue

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisConnection added in v0.6.0

func NewRedisConnection(config RedisConnConfig) *redis.Client

Types

type ChannelQueue added in v0.6.0

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

func NewChannelQueue added in v0.6.0

func NewChannelQueue(ctx context.Context) *ChannelQueue

func (*ChannelQueue) Add added in v0.6.0

func (c *ChannelQueue) Add(item CrawlItem) bool

func (*ChannelQueue) Close added in v0.6.0

func (c *ChannelQueue) Close()

func (*ChannelQueue) Fetch added in v0.6.0

func (c *ChannelQueue) Fetch(count int64) <-chan []CrawlItem

func (*ChannelQueue) Reset added in v0.6.0

func (c *ChannelQueue) Reset() bool

func (*ChannelQueue) Size added in v0.6.0

func (c *ChannelQueue) Size() int

type CrawlItem added in v0.6.0

type CrawlItem struct {
	URL   string
	Depth int
}

type QueueInterface added in v0.6.0

type QueueInterface interface {
	Add(item CrawlItem) bool
	Fetch(count int64) <-chan []CrawlItem
	Reset() bool
	Size() int
	Close()
}

type RedisConnConfig added in v0.6.0

type RedisConnConfig struct {
	Port     int
	DB       int
	Address  string
	Password string
	Username string
}

type RedisQueue added in v0.6.0

type RedisQueue struct {
	ID   int
	Host string
	// contains filtered or unexported fields
}

func NewRedisQueue added in v0.6.0

func NewRedisQueue(ctx context.Context, ID int, host string, rdb *redis.Client) *RedisQueue

func (*RedisQueue) Add added in v0.6.0

func (c *RedisQueue) Add(item CrawlItem) bool

func (*RedisQueue) Close added in v0.6.1

func (c *RedisQueue) Close()

func (*RedisQueue) Fetch added in v0.6.0

func (c *RedisQueue) Fetch(count int64) <-chan []CrawlItem

func (*RedisQueue) Reset added in v0.6.0

func (c *RedisQueue) Reset() bool

func (*RedisQueue) Size added in v0.6.0

func (c *RedisQueue) Size() int

Jump to

Keyboard shortcuts

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