util

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 9 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 FileDoesNotExist added in v0.12.3

func FileDoesNotExist(filePath string) bool

FileDoesNotExist check if a 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 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(source, name string) (string, error)

PathSetup will create the folders where the comic will be saved

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