postgres

package
v0.0.0-...-0bc28f7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository defines a sql notification repository

func New

func New(db *sql.DB) *Repository

New creates a new memory repository

func (*Repository) AssociateUserWithChat

func (r *Repository) AssociateUserWithChat(ctx context.Context, userID, chatID string) error

AssociateUserWithChat associates a user with a chat

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, id string) (*model.Notification, error)

Get notification by id

func (*Repository) List

func (r *Repository) List(ctx context.Context, chatID string) ([]*model.Notification, error)

List notification by user chatID

func (*Repository) ListChats

func (r *Repository) ListChats(ctx context.Context, userID string) ([]string, error)

ListChats retrieves chat IDs for a given user ID

func (*Repository) ListUsers

func (r *Repository) ListUsers(ctx context.Context, chatID string) ([]string, error)

ListUsers retrieves user IDs for a given chat ID

func (*Repository) Post

func (r *Repository) Post(ctx context.Context, chatID string, n *model.Notification) (int, error)

Post adds a new notification

Jump to

Keyboard shortcuts

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