db

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(c *di.Container)

Types

type PreferenceRepository

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

func NewPeferenceRepository

func NewPeferenceRepository(db *sqlx.DB) *PreferenceRepository

func (*PreferenceRepository) ListByUserID

func (repo *PreferenceRepository) ListByUserID(ctx context.Context, userID string) ([]*notification.Preference, error)

func (*PreferenceRepository) Upsert

func (repo *PreferenceRepository) Upsert(ctx context.Context, preference *notification.Preference) error

type Repository

type Repository interface {
	Get(id string) (notification.Notification, error)
	Create(notification.Notification) error
	Update(notification.Notification) error
	// todo: use id based pagination instead of offset
	ListByUser(userID string, limit, offset int) ([]notification.Notification, error)
	ListByUserAndIds(userID string, ids []string) ([]notification.Notification, error)
	ArchiveByUserAndIds(userID string, ids []string) error
}

func NewRepository

func NewRepository(db *sqlx.DB) Repository

Jump to

Keyboard shortcuts

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