memory

package
v0.0.0-...-eee2b2e Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryStorage

func NewMemoryStorage() storage.Storage

NewMemoryStorage constructor.

Types

type MemoryStorage

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

MemoryStorage makes memory implementation of Storage interface.

func (*MemoryStorage) AddRequest

func (s *MemoryStorage) AddRequest(data *model.FetchData) (string, error)

AddFetchData saves fetch data and return ID.

func (*MemoryStorage) AddResponse

func (s *MemoryStorage) AddResponse(id string, response *model.Response) error

AddResponse saves response from external resource by request ID.

func (*MemoryStorage) DeleteRequest

func (s *MemoryStorage) DeleteRequest(id string) error

DeleteRequest removes request from storage by ID.

func (*MemoryStorage) GetAllRequests

func (s *MemoryStorage) GetAllRequests(paginator *model.Paginator) []model.Request

GetAllRequests reads all requests from storage.

Jump to

Keyboard shortcuts

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