storage

package
v0.0.0-...-14027f3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("source already registered")
View Source
var ErrInternal = errors.New("source storage internal failure")
View Source
var ErrNotFound = errors.New("source not registered")

Functions

This section is empty.

Types

type Storage

type Storage interface {
	io.Closer
	Create(ctx context.Context, src model.Source) (err error)
	Read(ctx context.Context, srcId string) (src model.Source, err error)
	Update(ctx context.Context, src model.Source) (err error)
	Delete(ctx context.Context, srcId, groupId, userId string) (err error)
	List(ctx context.Context, filter model.Filter, limit uint32, cursor string, order model.Order) (page []string, 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 NewStorageMock

func NewStorageMock() Storage

Jump to

Keyboard shortcuts

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