Documentation ¶
Index ¶
- Variables
- func CacheDir() string
- func DefaultCacheDir() string
- func DeleteNil(errs []error) (new []error)
- func DeleteRecordNotFound(errs []error) (new []error)
- func DiffRedhat(old, new *models.RedhatCVE, config config.RedhatWatchCve) (body string)
- func Exec(command string, args []string) (string, error)
- func Exists(path string) (bool, error)
- func FetchConcurrently(urls []string, concurrency, wait int) (responses [][]byte, err error)
- func FetchURL(url, apikey string) ([]byte, error)
- func FileWalk(root string, targetFiles map[string]struct{}, ...) error
- func FilterTargets(prefixPath string, targets map[string]struct{}) (map[string]struct{}, error)
- func GenWorkers(num, wait int) chan<- func()
- func GetDefaultLogDir() string
- func IsCommandAvailable(name string) bool
- func Major(osVer string) (majorVersion string)
- func SetCacheDir(dir string)
- func SetLogger(logDir string, debug, logJSON bool)
- func StringInSlice(a string, list []string) bool
- func TrimSpaceNewline(str string) string
- type Errors
- type ProgressBar
- type Spinner
Constants ¶
This section is empty.
Variables ¶
var ( // Quiet manages the display of NewSpinner, ProgressBar Quiet = false )
Functions ¶
func DefaultCacheDir ¶ added in v0.1.10
func DefaultCacheDir() string
DefaultCacheDir set default cache dir
func DeleteRecordNotFound ¶
DeleteRecordNotFound deletes gorm.ErrRecordNotFound in errs
func DiffRedhat ¶
func DiffRedhat(old, new *models.RedhatCVE, config config.RedhatWatchCve) (body string)
DiffRedhat returns the difference between the old and new CVE information
func FetchConcurrently ¶
FetchConcurrently fetches concurrently
func FileWalk ¶ added in v0.1.10
func FileWalk(root string, targetFiles map[string]struct{}, walkFn func(r io.Reader, path string) error) error
FileWalk walks the file tree rooted at root
func FilterTargets ¶ added in v0.1.10
FilterTargets filter targets
func GetDefaultLogDir ¶
func GetDefaultLogDir() string
GetDefaultLogDir returns default log directory
func IsCommandAvailable ¶ added in v0.1.10
IsCommandAvailable check if command is available.
func StringInSlice ¶ added in v0.1.10
StringInSlice search within Slice by String
func TrimSpaceNewline ¶
TrimSpaceNewline deletes space character and newline character(CR/LF)
Types ¶
type Errors ¶ added in v0.2.0
type Errors []error
Errors has a set of errors that occurred in GORM
type ProgressBar ¶ added in v0.1.10
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar has ProgressBar client
func PbStartNew ¶ added in v0.1.10
func PbStartNew(total int) *ProgressBar
PbStartNew creates a ProgressBar
func (*ProgressBar) Finish ¶ added in v0.1.10
func (p *ProgressBar) Finish()
Finish to exit the ProgressBar
func (*ProgressBar) Increment ¶ added in v0.1.10
func (p *ProgressBar) Increment()
Increment increments the ProgressBar
type Spinner ¶ added in v0.1.10
type Spinner struct {
// contains filtered or unexported fields
}
Spinner has Spinner client
func NewSpinner ¶ added in v0.1.10
NewSpinner creates a Spinner