quotes

package
v0.0.0-...-b14b177 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package quotes contains the quotes storage in memory implementation.

Index

Constants

This section is empty.

Variables

View Source
var ErrDBEmpty = errors.New("db is empty")

ErrDBEmpty is returned when the db is empty.

Functions

func GetQuotes

func GetQuotes() []model.Quote

GetQuotes returns all hardcoded quotes. This is done to avoid referencing a global variable directly.

Types

type StorageInMemory

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

StorageInMemory is a quote storage in memory.

func NewStorageInMemory

func NewStorageInMemory(logger *zap.Logger, db []model.Quote) *StorageInMemory

NewStorageInMemory creates a new quote storage in memory.

func (*StorageInMemory) GetQuoteList

func (s *StorageInMemory) GetQuoteList(ctx context.Context) ([]model.Quote, error)

GetQuoteList returns a list of quotes.

Jump to

Keyboard shortcuts

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