util

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CollectorPathPrefix = "collector/"
View Source
const RequestInterval = 3 * time.Second
View Source
const RequestTimeout = 5 * time.Minute

Variables

This section is empty.

Functions

func FailIfNeedLogin

func FailIfNeedLogin(body *string)

FailIfNeedLogin will fail the execution if the page requires login.

func GetFilePathListWithPattern

func GetFilePathListWithPattern(basePath, fileNamePattern string) []string

GetFilePathListWithPattern returns the full paths for files matching the pattern in the base path.

func GetPathWithCreation

func GetPathWithCreation(subdirs string) (string, error)

GetPathWithCreation returns the concatenated path with output path and have them created in advance.

func GetPathWithCreationWithBase

func GetPathWithCreationWithBase(base, subdirs string) (string, error)

GetPathWithCreationWithBase returns the concatenated path with base path and have them created in advance.

func LoadCookiesFile

func LoadCookiesFile(filePath string) ([]*http.Cookie, error)

LoadCookiesFile loads the external cookies file.

func LoadCookiesFileToString

func LoadCookiesFileToString(filePath string) (string, error)

LoadCookiesFileToString loads the external cookies file.

func MergeSpaces

func MergeSpaces(str *string) string

MergeSpaces merges all space characters into one regular space.

func NewColly

func NewColly() *colly.Collector

NewColly creates the Colly Collector based on my needs.

func NewQueue

func NewQueue() *queue.Queue

NewQueue creates the Colly Request Queue based on my needs.

func ReadEntireFile

func ReadEntireFile(fullPath string) string

ReadEntireFile reads the entire file to a string.

func StripAllSpaces

func StripAllSpaces(str *string) string

StripAllSpaces removes all space characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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