storage

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceID = "core.storage"

Variables

This section is empty.

Functions

This section is empty.

Types

type SQL

type SQL struct {
	Clock syncf.Clock
	DB    *gorm.DB
	IsPG  bool
}

func (*SQL) CountEventsBy

func (s *SQL) CountEventsBy(ctx context.Context, feedID feed.ID, since time.Time, key string, multipliers map[string]float64) (map[string]int64, error)

func (*SQL) CreateSubscription

func (s *SQL) CreateSubscription(ctx context.Context, sub *feed.Subscription) error

func (*SQL) DeleteAllSubscriptions

func (s *SQL) DeleteAllSubscriptions(ctx context.Context, feedID feed.ID, errorLike string) (int64, error)

func (*SQL) EventTx

func (s *SQL) EventTx(ctx context.Context, body func(tx feed.EventTx) error) error

func (*SQL) GetActiveFeedIDs

func (s *SQL) GetActiveFeedIDs(ctx context.Context) ([]feed.ID, error)

func (*SQL) GetSubscription

func (s *SQL) GetSubscription(ctx context.Context, header feed.Header) (*feed.Subscription, error)

func (*SQL) IsMediaUnique

func (s *SQL) IsMediaUnique(ctx context.Context, hash *feed.MediaHash) (bool, error)

func (*SQL) ListSubscriptions

func (s *SQL) ListSubscriptions(ctx context.Context, feedID feed.ID, active bool) ([]feed.Subscription, error)

func (*SQL) SaveEvent

func (s *SQL) SaveEvent(ctx context.Context, feedID feed.ID, eventType string, value any) error

func (*SQL) ShiftSubscription

func (s *SQL) ShiftSubscription(ctx context.Context, feedID feed.ID) (*feed.Subscription, error)

func (*SQL) Tx

func (s *SQL) Tx(ctx context.Context, body func(tx feed.Tx) error) error

func (*SQL) UpdateSubscription

func (s *SQL) UpdateSubscription(ctx context.Context, header feed.Header, value any) error

Jump to

Keyboard shortcuts

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