database

package
v0.0.0-...-0ef1328 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT 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 DeleteRedirectParams

type DeleteRedirectParams struct {
	Short  string
	UserID string
}

type GetRedirectByShortParams

type GetRedirectByShortParams struct {
	Short  string
	UserID string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteRedirect

func (q *Queries) DeleteRedirect(ctx context.Context, arg DeleteRedirectParams) error

func (*Queries) ExpandRedirect

func (q *Queries) ExpandRedirect(ctx context.Context, short string) (string, error)

func (*Queries) GetRedirectByShort

func (q *Queries) GetRedirectByShort(ctx context.Context, arg GetRedirectByShortParams) (Redirect, error)

func (*Queries) GetUserByGoogleId

func (q *Queries) GetUserByGoogleId(ctx context.Context, googleProviderID string) (User, error)

func (*Queries) ListRedirectsByUserId

func (q *Queries) ListRedirectsByUserId(ctx context.Context, userID string) ([]Redirect, error)

func (*Queries) SaveRedirect

func (q *Queries) SaveRedirect(ctx context.Context, arg SaveRedirectParams) error

func (*Queries) SaveUser

func (q *Queries) SaveUser(ctx context.Context, arg SaveUserParams) error

func (*Queries) WithTx

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

type Redirect

type Redirect struct {
	Short     string
	Url       string
	UserID    string
	CreatedAt time.Time
}

type SaveRedirectParams

type SaveRedirectParams struct {
	Short     string
	Url       string
	UserID    string
	CreatedAt time.Time
}

type SaveUserParams

type SaveUserParams struct {
	ID               string
	Email            string
	GoogleProviderID string
}

type User

type User struct {
	ID               string
	Email            string
	GoogleProviderID string
}

Jump to

Keyboard shortcuts

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