pgstore

package
v0.0.0-...-e9d1c2e Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMessageParams

type CreateMessageParams struct {
	RoomID  uuid.UUID
	Message string
}

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 Message

type Message struct {
	ID            uuid.UUID
	RoomID        uuid.UUID
	Message       string
	ReactionCount int64
	Answered      bool
	CreatedAt     pgtype.Timestamp
	UpdatedAt     pgtype.Timestamp
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AnswerMessage

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

func (*Queries) CreateMessage

func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (Message, error)

func (*Queries) CreateRoom

func (q *Queries) CreateRoom(ctx context.Context, theme string) (Room, error)

func (*Queries) DeleteMessage

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

func (*Queries) DeleteRoom

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

func (*Queries) GetAnsweredMessages

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

func (*Queries) GetMessages

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

func (*Queries) GetRoom

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

func (*Queries) GetRooms

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

func (*Queries) UnanswerMessage

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

func (*Queries) UpdateMessage

func (q *Queries) UpdateMessage(ctx context.Context, arg UpdateMessageParams) (Message, error)

func (*Queries) UpdateRoom

func (q *Queries) UpdateRoom(ctx context.Context, arg UpdateRoomParams) (Room, error)

func (*Queries) WithTx

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

type Room

type Room struct {
	ID        uuid.UUID
	Theme     string
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

type UpdateMessageParams

type UpdateMessageParams struct {
	Message string
	ID      uuid.UUID
}

type UpdateRoomParams

type UpdateRoomParams struct {
	Theme string
	ID    uuid.UUID
}

Jump to

Keyboard shortcuts

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