Skip to content

Commit

Permalink
Fix godocs (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Pastro committed Aug 9, 2023
1 parent 5b00863 commit 33221ec
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pgmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func (p *PGMQ) Close() {

// CreateQueue creates a new queue. This sets up the queue's tables, indexes,
// and metadata.
func (p *PGMQ) CreateQueue(ctx context.Context, name string) error {
_, err := p.pool.Exec(ctx, "select pgmq_create($1)", name)
func (p *PGMQ) CreateQueue(ctx context.Context, queue string) error {
_, err := p.pool.Exec(ctx, "select pgmq_create($1)", queue)
if err != nil {
return wrapPostgresError(err)
}
Expand Down Expand Up @@ -181,9 +181,8 @@ func (p *PGMQ) Pop(ctx context.Context, queue string) (*Message, error) {

// Archive moves a message from the queue table to archive table by its id.
// View messages on the archive table with sql:
// ```sql
// SELECT * FROM pgmq_<queue_name>_archive;
// ```
//
// select * from pgmq_<queue_name>_archive;
func (p *PGMQ) Archive(ctx context.Context, queue string, msgID int64) (int64, error) {
var archived bool
err := p.pool.QueryRow(ctx, "select pgmq_archive($1, $2)", queue, msgID).Scan(&archived)
Expand Down

0 comments on commit 33221ec

Please sign in to comment.