core

package
v0.0.0-...-7e7c3a5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerError          = errors.New("500 server error")
	ErrWrongURL             = errors.New("given url is wrong")
	ErrOnlyJpg              = errors.New("only jpg and jpeg images are accepted")
	ErrCouldntDownloadImage = errors.New("couldn't download image from remote host")
	ErrCouldntSaveImage     = errors.New("couldn't save image to the local storage")
	ErrCouldntDecodeImage   = errors.New("couldn't decode image from jpeg")
)

Functions

This section is empty.

Types

type DownloadImageInput

type DownloadImageInput struct {
	URL    string
	Header http.Header
}

type Image

type Image struct {
	Name         string
	Extension    string
	File         *os.File
	DecodedImage image.Image
}

func (*Image) Crop

func (i *Image) Crop(width, height int) (image.Image, error)

func (*Image) GetFullName

func (i *Image) GetFullName() string

func (*Image) GetFullNameWithWidthAndHeight

func (i *Image) GetFullNameWithWidthAndHeight(width, height int) string

type ResizeInput

type ResizeInput struct {
	Header   http.Header
	ImageURL string
	Width    int
	Height   int
}

type ServerResponse

type ServerResponse struct {
	Data string
}

Jump to

Keyboard shortcuts

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