interfaces

package
v0.0.0-...-f18c969 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageHandler

type StorageHandler interface {
	Add(hash string, image image.Image)
	Get(hash string) (image.Image, bool)
}

StorageHandler allows us to swap in different implementations of the actual storage method

type ThumbnailInteractor

type ThumbnailInteractor interface {
	Get(hash string) (image.Image, error)
}

type ThumbnailStorageRepo

type ThumbnailStorageRepo struct {
	StorageHandler StorageHandler
}

func NewThumbnailStorageRepo

func NewThumbnailStorageRepo(handler StorageHandler) *ThumbnailStorageRepo

func (*ThumbnailStorageRepo) Add

func (tr *ThumbnailStorageRepo) Add(thumbnail domain.Thumbnail)

func (*ThumbnailStorageRepo) Get

func (tr *ThumbnailStorageRepo) Get(hash string) (domain.Thumbnail, bool)

type WebserviceHandler

type WebserviceHandler struct {
	ThumbnailInteractor ThumbnailInteractor
}

WebserviceHandler needs a ThumbnailInteractor to get the thumbnail generation going

func (WebserviceHandler) GetThumbnail

func (handler WebserviceHandler) GetThumbnail(w http.ResponseWriter, req *http.Request)

GetThumbnail processes the incoming request and returns a resized image, the error otherwise

Jump to

Keyboard shortcuts

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