writers

package
v1.1.1-rc-75 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWriter

type FileWriter struct{}

FileWriter - One implementation of the Writer interface. This one will write to txt files, and generate file names like yyyy-mm-dd-exchange-market.txt.

func (*FileWriter) GetWriteFileName

func (f *FileWriter) GetWriteFileName(exchange string, market string) string

GetWriteFileName - Will generate the file name for you of the format yyyy-mm-dd-exchange-market.txt. New files will be created at midnight because the scrapers are calling this method each time before writing to file.

func (*FileWriter) Write

func (f *FileWriter) Write(line string, filename string) (int, error)

Write - Will write to the filename the line.

type Writer

type Writer interface {
	GetWriteFileName(exchange string, market string) string // will return the name of the file in which it will write
	Write(line string, filename string) (int, error)        // returns number of bytes written or error

}

Writer is an interface that is responsible for generating dynamic file names (to create new files at midnight) and writing data to them

Jump to

Keyboard shortcuts

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