util

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNil

func DeleteNil(errs []error) (new []error)

DeleteNil deletes nil in errs

func DeleteRecordNotFound

func DeleteRecordNotFound(errs []error) (new []error)

DeleteRecordNotFound deletes gorm.ErrRecordNotFound in errs

func DiffRedhat

func DiffRedhat(old, new *models.RedhatCVE, config config.RedhatWatchCve) (body string)

func FetchConcurrently

func FetchConcurrently(urls []string, concurrency, wait int) (responses [][]byte, err error)

FetchConcurrently fetches concurrently

func FetchURL

func FetchURL(url, apikey string) ([]byte, error)

FetchURL returns HTTP response body

func GenWorkers

func GenWorkers(num, wait int) chan<- func()

GenWorkers generate workders

func GetDefaultLogDir

func GetDefaultLogDir() string

GetDefaultLogDir returns default log directory

func Major

func Major(osVer string) (majorVersion string)

Major returns major version

func SetLogger

func SetLogger(logDir string, debug, logJSON bool)

SetLogger set logger

func TrimSpaceNewline

func TrimSpaceNewline(str string) string

TrimSpaceNewline deletes space character and newline character(CR/LF)

Types

This section is empty.

Jump to

Keyboard shortcuts

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