infrastructure

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64Decoder

type Base64Decoder struct{}

Base64Decoder is a simple base64 decoder

func (Base64Decoder) Decode

Decode decodes the given hash and returns an imageDescription, error otherwise

type CappedMemoryStorage

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

CappedMemoryStorage is a simple in memory storage for images

func NewCappedMemoryStorage

func NewCappedMemoryStorage(capacity int) *CappedMemoryStorage

NewCappedMemoryStorage returns a new initialized CappedMemoryStorage with initial capacity

func (*CappedMemoryStorage) Add

func (ms *CappedMemoryStorage) Add(hash string, image image.Image)

Add adds a new image to the storage under the key hash

func (*CappedMemoryStorage) Get

func (ms *CappedMemoryStorage) Get(hash string) (image.Image, bool)

Get returns the image and a found flag for the given hash

type ConsoleLogger

type ConsoleLogger struct{}

ConsoleLogger simply logs to the console

func (ConsoleLogger) Log

func (l ConsoleLogger) Log(format string, args ...interface{})

Log logs the given msg

type ImageFetcher

type ImageFetcher struct{}

ImageFetcher implements the ImageFetcher usecases interface

func (ImageFetcher) Fetch

func (i ImageFetcher) Fetch(path string) (image.Image, error)

Fetch fetches and returns the image found at url, error otherwise

type MNResizer

type MNResizer struct{}

MNResizer is an image resizer using the Mitchell-Netravali algorithm

func (MNResizer) Resize

func (r MNResizer) Resize(img image.Image, w, h int) (image.Image, error)

Jump to

Keyboard shortcuts

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