image

package
v0.0.0-...-cc1fd88 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSize

func CheckSize(imageByte []byte, x, y int) error

func ValidateImage

func ValidateImage(ctx context.Context, file *multipart.FileHeader, maxSize int) ([]byte, *string, error)

ValidateImage 拡張子やファイルサイズなどの画像のバリデーションを行う

Types

type Image

type Image []byte

func NewImage

func NewImage(image []byte) Image

func (*Image) GetImage

func (i *Image) GetImage() []byte

func (*Image) GetImageReader

func (i *Image) GetImageReader() io.Reader

type ImageInfo

type ImageInfo struct {
	// contains filtered or unexported fields
}

func NewImageInfo

func NewImageInfo(
	filePath string,
	contentType string,
	image Image,
) *ImageInfo

func (*ImageInfo) ContentType

func (i *ImageInfo) ContentType() string

func (*ImageInfo) FilePath

func (i *ImageInfo) FilePath() string

func (*ImageInfo) ImageReader

func (i *ImageInfo) ImageReader() io.Reader

type ImageRepository

type ImageRepository interface {
	Create(context.Context, ImageInfo) (*string, error)
}

Jump to

Keyboard shortcuts

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