helper

package
v0.0.0-...-0a5c495 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInSlice

func FindInSlice(slice []string, val string) (int, bool)

FindInSlice iterates over the slice and returns the position of the element if found

func GenerateSHA1

func GenerateSHA1(reader io.Reader) (string, error)

GenerateSHA1 generates a sha1 hash for the specified reader

func ParseConfig

func ParseConfig(config string) models.Config

ParseConfig parses the config file into the config object

func PathExists

func PathExists(path string) bool

PathExists checks if a given path is available on the filesystem

func ReadContent

func ReadContent(reader io.Reader) ([]byte, error)

ReadContent reads the content from a reader into a byte array

func ReadFile

func ReadFile(path string) (*os.File, error)

ReadFile reads a given file

func ReadFileAndContent

func ReadFileAndContent(path string) (*os.File, []byte, error)

ReadFileAndContent reads a given file and reads its content into a byte array

func ReadJSONFile

func ReadJSONFile(config string) (*json.Decoder, *os.File)

ReadJSONFile tries to open a specified config file

func Thumbnail

func Thumbnail(file *os.File, thumbSize uint) (io.Reader, *th.Source)

Thumbnail creates a thumbnail from the passed file reader

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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