output

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIWriter added in v0.1.3

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

The APIWriter is meant to write to a custom API and assumes many things. So currently, it is better not to use this APIWriter.

func NewAPIWriter added in v0.1.3

func NewAPIWriter(wc *WriterConfig) *APIWriter

NewAPIWriter returns a new APIWriter

func (*APIWriter) Write added in v0.1.3

func (f *APIWriter) Write(items chan map[string]interface{}, wg *sync.WaitGroup)

type FileWriter added in v0.1.9

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

func NewFileWriter added in v0.1.9

func NewFileWriter(wc *WriterConfig) *FileWriter

NewFileWriter returns a new FileWriter

func (*FileWriter) Write added in v0.1.9

func (fr *FileWriter) Write(items chan map[string]interface{}, wg *sync.WaitGroup)

type StdoutWriter added in v0.1.3

type StdoutWriter struct{}

func (*StdoutWriter) Write added in v0.1.3

func (s *StdoutWriter) Write(items chan map[string]interface{}, wg *sync.WaitGroup)

type Writer added in v0.1.3

type Writer interface {
	// if a writer encounters a fatal error it should call log.Fatalf
	// to prevent the crawler from uselessly continuing to run.
	Write(itemsList chan map[string]interface{}, wg *sync.WaitGroup)
}

type WriterConfig added in v0.2.1

type WriterConfig struct {
	Type     string `yaml:"type" env:"WRITER_TYPE" env-default:"stdout"`
	Uri      string `yaml:"uri" env:"WRITER_URI"`
	User     string `yaml:"user" env:"WRITER_USER"`
	Password string `yaml:"password" env:"WRITER_PASSWORD"`
	FilePath string `yaml:"filepath" env:"WRITER_FILEPATH"`
}

.WriterConfig defines the necessary paramters to make a new writer which is responsible for writing the scraped data to a specific output eg. stdout.

Jump to

Keyboard shortcuts

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