db

package
v0.0.0-...-d0758bc Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func InsertGiggle

func InsertGiggle(ctx context.Context, giggle schema.Giggle) error

func ListGiggles

func ListGiggles(ctx context.Context, skip uint64, take uint64) ([]schema.Giggle, error)

func SetRepository

func SetRepository(repository Repository)

Types

type PostgresRepository

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

func NewPostgres

func NewPostgres(url string) (*PostgresRepository, error)

func (*PostgresRepository) Close

func (r *PostgresRepository) Close()

func (*PostgresRepository) InsertGiggle

func (r *PostgresRepository) InsertGiggle(ctx context.Context, giggle schema.Giggle) error

func (*PostgresRepository) ListGiggles

func (r *PostgresRepository) ListGiggles(ctx context.Context, skip uint64, take uint64) ([]schema.Giggle, error)

type Repository

type Repository interface {
	Close()
	InsertGiggle(ctx context.Context, giggle schema.Giggle) error
	ListGiggles(ctx context.Context, skip uint64, take uint64) ([]schema.Giggle, error)
}

Repository interface

Jump to

Keyboard shortcuts

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