xivish

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

README

XIVISH

FFXIV Scraper and Utilities


Installation

To get started with XIVISH, add the module to your Go project.

go get github.com/punishxiv/xivish@v1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	Id         int
	Avatar     string
	Name       string
	Title      string
	Bio        string
	Server     string
	DataCenter string
}

type CharacterScraper

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

func (CharacterScraper) AddCharacterToQueue

func (s CharacterScraper) AddCharacterToQueue(region string, id int) error

AddCharacterToQueue adds a character to the queue

type Logger

type Logger struct {
	DisableAll bool
	Queue      LoggerQueueCfg
}

func (*Logger) Close

func (l *Logger) Close()

Close stops the logging

func (*Logger) Disable

func (l *Logger) Disable()

DisableAll disables all logging

func (*Logger) LogError

func (l *Logger) LogError(prefix string, msg any)

LogError logs an error message

func (*Logger) LogInfo

func (l *Logger) LogInfo(prefix string, msg any)

LogInfo logs an info message

func (*Logger) SetQueueState

func (l *Logger) SetQueueState(enabled bool, interval *time.Duration)

SetQueueState sets whether the queue progress should be logged and the interval

type LoggerQueueCfg

type LoggerQueueCfg struct {
	Enabled  bool
	Interval time.Duration
	// contains filtered or unexported fields
}

type Scraper

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

func NewScraper

func NewScraper() Scraper

NewScraper creates a new scraper

func (*Scraper) AttachCharacterCollector

func (s *Scraper) AttachCharacterCollector(cb func(character Character)) CharacterScraper

AttachCharacterCollector attaches a character collector to the scraper

func (*Scraper) AttachLogger

func (s *Scraper) AttachLogger(logger Logger)

AttachLogger attaches a logger to the scraper

func (*Scraper) AttachQueue

func (s *Scraper) AttachQueue(threads int, maxSize int) error

SetupQueue sets up the queue for the scraper

func (Scraper) Close

func (s Scraper) Close()

Close closes the scraper

func (Scraper) Restart

func (s Scraper) Restart(delay time.Duration) error

Restart stops the queue and starts it again after a delay

func (Scraper) SetLimiter

func (s Scraper) SetLimiter(duration time.Duration, parallel int) error

SetLimiter sets the rate limiter for the scraper

func (Scraper) StartQueue

func (s Scraper) StartQueue() error

StartQueue initiates scraping with the queue

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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