utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVWriterUtil

type CSVWriterUtil struct {
}

func (*CSVWriterUtil) Flush

func (u *CSVWriterUtil) Flush(csvWriter *csv.Writer)

func (*CSVWriterUtil) Init

func (u *CSVWriterUtil) Init(w io.Writer) *csv.Writer

func (*CSVWriterUtil) Write

func (u *CSVWriterUtil) Write(csvWriter *csv.Writer, record []string) error

type CSVWriterUtilInterface

type CSVWriterUtilInterface interface {
	Init(w io.Writer) *csv.Writer
	Flush(csvWriter *csv.Writer)
	Write(csvWriter *csv.Writer, record []string) error
}

func NewCSVWriter

func NewCSVWriter() CSVWriterUtilInterface

type FetcherUtil

type FetcherUtil struct {
	Client         *http.Client
	NewRequestFunc func(method string, url string, body io.Reader) (*http.Request, error)
}

func (*FetcherUtil) Do

func (u *FetcherUtil) Do(client *http.Client, req *http.Request) (*http.Response, error)

func (*FetcherUtil) FetchData

func (u *FetcherUtil) FetchData(url string) ([]byte, error)

func (*FetcherUtil) NewRequest

func (u *FetcherUtil) NewRequest(method string, url string, body io.Reader) (*http.Request, error)

type FetcherUtilInterface

type FetcherUtilInterface interface {
	NewRequest(method, url string, body io.Reader) (*http.Request, error)
	Do(client *http.Client, req *http.Request) (*http.Response, error)
	FetchData(url string) ([]byte, error)
}

func NewFetcher

func NewFetcher(client *http.Client, newRequestFunc func(method, url string, body io.Reader) (*http.Request, error)) FetcherUtilInterface

type URLParserUtil

type URLParserUtil struct{}

func (*URLParserUtil) Parse

func (u *URLParserUtil) Parse(rawURL string) (*url.URL, error)

type URLParserUtilInterface

type URLParserUtilInterface interface {
	Parse(rawURL string) (*url.URL, error)
}

func NewURLParser

func NewURLParser() URLParserUtilInterface

Jump to

Keyboard shortcuts

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