request

package
v0.0.0-...-d46a54d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	DeleteRequests()
	GetRequests() []domain.Request
	GetRequest(ID string) (domain.Request, error)
}

Service is service for requests domain

func NewService

func NewService(logger *zerolog.Logger, cache Storage) Service

NewService creates new instance of request service

type Storage

type Storage interface {
	Set(req domain.Request)
	Get(ID string) (domain.Request, bool)
	GetAllIDs() []string
	GetAll() []domain.Request
	DeleteAll()
}

Storage is cache for request and their responses

func NewStorage

func NewStorage(storageSize int, storageDuration time.Duration) Storage

NewStorage creates new request cache instance

Jump to

Keyboard shortcuts

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