usecases

package
v0.0.0-...-535ab37 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLRUCache

func NewLRUCache(size int, storage interfaces.Storage) interfaces.Cache

NewLRUCache constructor.

Types

type DllItem

type DllItem struct {
	Value interface{}
	Next  *DllItem
	Prev  *DllItem
}

type DoublyLinkedList

type DoublyLinkedList struct {
	Tail   *DllItem
	Length int
	// contains filtered or unexported fields
}

func (*DoublyLinkedList) Clean

func (l *DoublyLinkedList) Clean()

func (*DoublyLinkedList) GetHead

func (l *DoublyLinkedList) GetHead() *DllItem

func (*DoublyLinkedList) GetLength

func (l *DoublyLinkedList) GetLength() int

func (*DoublyLinkedList) MoveHead

func (l *DoublyLinkedList) MoveHead(i *DllItem)

Move item to the head of doubly linked list.

func (*DoublyLinkedList) PopTail

func (l *DoublyLinkedList) PopTail() interface{}

Remove tail item and return its value.

func (*DoublyLinkedList) PushHead

func (l *DoublyLinkedList) PushHead(v interface{}) *DllItem

Push value to the head of doubly linked list.

type LRUCache

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

LRUCache implements Least Recently Used cache

func (*LRUCache) Clean

func (c *LRUCache) Clean() error

Clean cache totally.

func (*LRUCache) Get

func (c *LRUCache) Get(params *entities.PreviewParams) (*entities.Preview, error)

Get preview from cache.

func (*LRUCache) HasPreview

func (c *LRUCache) HasPreview(params *entities.PreviewParams) bool

HasPreview searches preview in cache.

func (*LRUCache) Save

func (c *LRUCache) Save(preview *entities.Preview) error

Save preview to cache.

type Previewer

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

Previewer object for image operations

func NewPreviewer

func NewPreviewer(
	loader interfaces.ImageLoader,
	processor interfaces.ImageProcessor,
	senders []interfaces.Sender,
) *Previewer

NewPreviewer constructor.

func (*Previewer) Process

func (p *Previewer) Process(request *entities.Request, obj interface{})

Process proxy request to preview response.

Jump to

Keyboard shortcuts

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