helpers

package
v0.0.0-...-412bf38 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package helpers contains some helper functions for Herald

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirExists

func CheckDirExists(dirPath string) error

CheckDirExists is used to check a directory exists

func CheckFileExists

func CheckFileExists(filename string) bool

CheckFileExists checks a returns true if a file exists and is not a directory.

func CheckLatestRelease

func CheckLatestRelease() (bool, string, string, error)

CheckLatestRelease will query the GitHub API check the latest released version of Herald against the one in use returns a bool indicating if there is a newer version available, the newest release tag, a link to the release, and any error

func DeduplicateStringSlice

func DeduplicateStringSlice(s []string) []string

DeduplicateStringSlice returns a slice with duplicate entries removed

func GlobFiles

func GlobFiles(searchDir string, patterns []string) ([]string, error)

GlobFiles will take a search directory and a pattern, returning all matching filenames in a slice. E.g. files, err := GlobFiles(/tmp, []string{"*.fastq", "*.fq"})

func NetworkActive

func NetworkActive() bool

NetworkActive is a helper function to check outgoing calls can be made TODO: this is only temporary as it's not a great check, we need to check API endpoints instead

Types

This section is empty.

Jump to

Keyboard shortcuts

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