util

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const IMAGEREGEX = `<img[^>]+src="([^">]+)"`

IMAGEREGEX to extract the image html tag

Variables

This section is empty.

Functions

func ConvertToJPG added in v0.12.1

func ConvertToJPG(img image.Image, imgData *bytes.Buffer) error

ConvertToJPG converts an image to jpeg

func CurrentDir added in v0.10.1

func CurrentDir() (string, error)

CurrentDir return the path where the executable is

func DirectoryOrFileDoesNotExist added in v0.17.0

func DirectoryOrFileDoesNotExist(filePath string) bool

DirectoryOrFileDoesNotExist check if a directory/file exist or not

func GenerateFileName added in v0.12.3

func GenerateFileName(dir, name, issueNumber, format string) string

GenerateFileName will return the path where the file should be saved

func ImageType added in v0.5.0

func ImageType(mimeStr string) (tp string)

ImageType return the image type

func ImagesPathSetup added in v0.17.0

func ImagesPathSetup(outputFolder, source, name, issueNumber string) (string, error)

func IsURLValid added in v0.6.1

func IsURLValid(value string) bool

IsURLValid will exclude those url containing `.gif` and `logo`.

func IsValueInSlice

func IsValueInSlice(valueToCheck string, values []string) bool

IsValueInSlice will check if a value is already in a slice.

func Parse added in v0.12.3

func Parse(s string) string

Parse is used to escape characters

func PathSetup added in v0.6.1

func PathSetup(outputFolder, source, name string) (string, error)

PathSetup will create the folders where the comic will be saved

func SaveImage added in v0.17.0

func SaveImage(w io.Writer, content io.Reader, format string) error

SaveImage saves an image from a given format

func TrimAndSplitURL added in v0.10.1

func TrimAndSplitURL(u string) []string

TrimAndSplitURL will trim tailing "/" and split url

func URLSource added in v0.6.1

func URLSource(u string) (string, error)

URLSource will retrieve the url hostname.

Types

This section is empty.

Jump to

Keyboard shortcuts

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