domain

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

Documentation

Overview

Package domain contains the domain entities and domain logic necessary for the thumbnail image cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thumbnail

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

Thumbnail encapsulates the actual thumbnail image but also tracks access time

func NewThumbnail

func NewThumbnail(hash string, image image.Image) Thumbnail

NewThumbnail creates a new thumbnail tying the hash with the image together

func (*Thumbnail) GetHash

func (t *Thumbnail) GetHash() string

GetHash returns the image hash

func (*Thumbnail) GetImage

func (t *Thumbnail) GetImage() image.Image

GetImage returns the image data and updates the internal data accordingly

type ThumbnailRepository

type ThumbnailRepository interface {
	Add(Thumbnail)
	Get(hash string) (Thumbnail, bool)
}

ThumbnailRepository allow to add and retrieve thumbnails

Jump to

Keyboard shortcuts

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