storage

package
v0.0.0-...-44b694c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("channel with the same id is already present")
View Source
var ErrInternal = errors.New("internal failure")
View Source
var ErrNotFound = errors.New("channel not found")

Functions

This section is empty.

Types

type Storage

type Storage interface {
	io.Closer
	Create(ctx context.Context, ch model.Channel) (err error)
	Read(ctx context.Context, link string) (ch model.Channel, err error)
	Update(ctx context.Context, link string, last time.Time) (err error)
	Delete(ctx context.Context, link string) (err error)
	GetPage(ctx context.Context, filter model.ChannelFilter, limit uint32, cursor string, order model.Order) (page []model.Channel, err error)
}

func NewLocalCache

func NewLocalCache(stor Storage, size int, ttl time.Duration) Storage

func NewStorage

func NewStorage(ctx context.Context, cfgDb config.DbConfig) (s Storage, err error)

func NewStorageLogging

func NewStorageLogging(stor Storage, log *slog.Logger) Storage

func NewStorageMock

func NewStorageMock() Storage

Jump to

Keyboard shortcuts

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