storage

package
v0.0.0-...-5d88ada Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArticleAlreadyExists = errors.New("tried to write to already existing article id")
View Source
var ArticleNotFound = errors.New("article not found")
View Source
var ArticleWriteFailed = errors.New("could not write article")

Functions

This section is empty.

Types

type ArticleReader

type ArticleReader interface {
	Get(types.ArticleId) (types.Article, error)
	GetNewsWithoutDetailsIDs() ([]string, error)
	List() ([]types.Article, error)
}

type ArticleStorage

type ArticleStorage interface {
	ArticleReader
	ArticleWriter
	Disconnect() error
}

type ArticleWriter

type ArticleWriter interface {
	// Write takes article to save
	Write(types.Article) error
	// Delete takes articleID and tries to delete it from the storage
	Delete(id types.ArticleId) error
}

Jump to

Keyboard shortcuts

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