Documentation ¶
Overview ¶
Package utils simply defines utility functions and types.
Index ¶
- Variables
- func CleanURL(str string) string
- func CompareStringLists(X, Y []string) []string
- func Contains(needle string, haystack []string) bool
- func Exec(dir string, bin string, args ...string) ([]byte, error)
- func Hash(str string) string
- func SelectivelyExtractArchive(r io.Reader, toExtract []string, maxFileSize int64) (map[string][]byte, error)
- type Stopper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCouldNotExtract occurs when an extraction fails. ErrCouldNotExtract = errors.New("utils: could not extract the archive") // ErrExtractedFileTooBig occurs when a file to extract is too big. ErrExtractedFileTooBig = errors.New("utils: could not extract one or more files from the archive: file too big") )
Functions ¶
func CompareStringLists ¶
CompareStringLists returns the strings which are present in X but not in Y
func Contains ¶
Contains looks for a string into an array of strings and returns whether the string exists
Types ¶
type Stopper ¶
type Stopper struct {
// contains filtered or unexported fields
}
Stopper eases the graceful termination of a group of goroutines
func (*Stopper) Chan ¶
func (s *Stopper) Chan() chan struct{}
Chan returns the channel on which goroutines could listen to determine if they should stop. The channel is closed when Stop() is called.
Directories ¶
Path | Synopsis |
---|---|
Package errors defines error types that are used in several modules
|
Package errors defines error types that are used in several modules |
Package types defines useful types that are used in database models.
|
Package types defines useful types that are used in database models. |
Click to show internal directories.
Click to hide internal directories.