repo

package
v0.0.0-...-c26c883 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CreateUser = `
        INSERT INTO users (username, password)
        VALUES ($1, $2)
        RETURNING id;
    `
	GetUserByName = `
        SELECT id, username, password
        FROM users
        WHERE username = $1;
    `
)

Functions

This section is empty.

Types

type Repo

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

func New

func New(db *sql.DB, logger *slog.Logger) *Repo

func (*Repo) CreateUser

func (r *Repo) CreateUser(ctx context.Context, u common.User) (*common.User, error)

func (*Repo) GetUserByUsername

func (r *Repo) GetUserByUsername(ctx context.Context, username string) (*common.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳