image

package
v0.0.0-...-c043ed3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThumbnailWidth  = uint(200)
	ThumbnailHeight = uint(200)
)

Variables

This section is empty.

Functions

func MakeCreateImagesPipeline1Transform1Filter

func MakeCreateImagesPipeline1Transform1Filter(service ImageService) *pipe.Pipeline

func MakeCreateImagesPipelineBoundedFilters

func MakeCreateImagesPipelineBoundedFilters(service ImageService) *pipe.Pipeline

func MakeCreateImagesPipelineNTransform1Filter

func MakeCreateImagesPipelineNTransform1Filter(service ImageService) *pipe.Pipeline

func MakeGetAllImagesPipeline

func MakeGetAllImagesPipeline(service ImageService) *pipe.Pipeline

func MakeGetImagePipeline

func MakeGetImagePipeline(service ImageService) *pipe.Pipeline

func NewImageService

func NewImageService(db *sql.DB) *imageService

Types

type Base64EncodeWorker

type Base64EncodeWorker struct {
}

func (*Base64EncodeWorker) Work

func (worker *Base64EncodeWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type CreateThumbnailWorker

type CreateThumbnailWorker struct {
	ImageService
}

func (*CreateThumbnailWorker) Work

func (worker *CreateThumbnailWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type GetMetadataWorker

type GetMetadataWorker struct {
	ImageService
}

func (*GetMetadataWorker) Work

func (worker *GetMetadataWorker) Work(ctx context.Context, in pipe.Item) (pipe.Item, error)

Work expects the input item to have one part - the id of the image

type Image

type Image struct {
	Id            int         `json:"id,omitempty"`
	Name          string      `json:"name"`
	Full          image.Image `json:"full,omitempty"`
	FullPath      string      `json:"fullPath"`
	Resolution    image.Point `json:"resolution,omitempty"`
	Thumbnail     image.Image `json:"thumbnail,omitempty"`
	ThumbnailPath string      `json:"thumbnailPath"`
}

func NewImage

func NewImage(name string, fullImage image.Image) *Image

type ImageBase64

type ImageBase64 struct {
	Id              int         `json:"id,omitempty"`
	Name            string      `json:"name"`
	FullBase64      string      `json:"fullBase64,omitempty"`
	FullPath        string      `json:"fullPath"`
	Resolution      image.Point `json:"resolution,omitempty"`
	ThumbnailBase64 string      `json:"thumbnailBase64,omitempty"`
	ThumbnailPath   string      `json:"thumbnailPath"`
}

func NewImageBase64

func NewImageBase64(img *Image) *ImageBase64

type ImageService

type ImageService interface {
	CreateThumbnail(ctx context.Context, image *Image) error
	Persist(ctx context.Context, image *Image) error
	SaveMetadata(ctx context.Context, image *Image) error
	GetAllMetadata(ctx context.Context) (<-chan *Image, <-chan error, error)
	GetMetadata(ctx context.Context, imageIds []int) ([]*Image, error)
	LoadThumbnail(ctx context.Context, img *Image) error
	LoadFull(ctx context.Context, img *Image) error
}

type LoadFullWorker

type LoadFullWorker struct {
	ImageService
}

func (*LoadFullWorker) Work

func (worker *LoadFullWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type LoadThumbnailWorker

type LoadThumbnailWorker struct {
	ImageService
}

func (*LoadThumbnailWorker) Work

func (worker *LoadThumbnailWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type PersistWorker

type PersistWorker struct {
	ImageService
}

func (*PersistWorker) Work

func (worker *PersistWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type RemoveFullImageWorker

type RemoveFullImageWorker struct {
}

func (*RemoveFullImageWorker) Work

func (worker *RemoveFullImageWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type SaveMetadataWorker

type SaveMetadataWorker struct {
	ImageService
}

func (*SaveMetadataWorker) Work

func (worker *SaveMetadataWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

type TransformFileHeaderWorker

type TransformFileHeaderWorker struct {
}

func (*TransformFileHeaderWorker) Work

func (worker *TransformFileHeaderWorker) Work(ctx context.Context, in pipe.Item) (out pipe.Item, err error)

Jump to

Keyboard shortcuts

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