pgstore

package
v0.0.0-...-158feaa Latest Latest
Warning

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

Go to latest
Published: Nov 17, 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 DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type InsertMessageParams

type InsertMessageParams struct {
	RoomID  uuid.UUID
	Message string
}

type Message

type Message struct {
	ID            uuid.UUID
	RoomID        uuid.UUID
	Message       string
	ReactionCount int64
	Answered      bool
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetMessage

func (q *Queries) GetMessage(ctx context.Context, id uuid.UUID) (Message, error)

func (*Queries) GetRoom

func (q *Queries) GetRoom(ctx context.Context, id uuid.UUID) (Room, error)

func (*Queries) GetRoomMessages

func (q *Queries) GetRoomMessages(ctx context.Context, roomID uuid.UUID) ([]Message, error)

func (*Queries) GetRooms

func (q *Queries) GetRooms(ctx context.Context) ([]Room, error)

func (*Queries) InsertMessage

func (q *Queries) InsertMessage(ctx context.Context, arg InsertMessageParams) (uuid.UUID, error)

func (*Queries) InsertRoom

func (q *Queries) InsertRoom(ctx context.Context, theme string) (uuid.UUID, error)

func (*Queries) MarkMessageAsAnswered

func (q *Queries) MarkMessageAsAnswered(ctx context.Context, id uuid.UUID) error

func (*Queries) ReactToMessage

func (q *Queries) ReactToMessage(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) RemoveReactionFromMessage

func (q *Queries) RemoveReactionFromMessage(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Room

type Room struct {
	ID    uuid.UUID
	Theme string
}

Jump to

Keyboard shortcuts

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