database

package
v0.0.0-...-5c0c614 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New(conn *pgxpool.Pool) *Database
func (db *Database) CreateLink(ctx context.Context, projectId, userId string) (string, error)

func (*Database) CreateProject

func (db *Database) CreateProject(ctx context.Context, id string) error

func (*Database) CreateUser

func (db *Database) CreateUser(ctx context.Context, username, password string) (string, error)

func (*Database) DeleteAll

func (db *Database) DeleteAll(ctx context.Context) error

func (*Database) Exec

func (db *Database) Exec(ctx context.Context, query ToSQL) (pgconn.CommandTag, error)

func (*Database) GetUserByUsername

func (database *Database) GetUserByUsername(ctx context.Context, username string) (User, error)

type ToSQL

type ToSQL interface {
	ToSQL() (sql string, params []interface{}, err error)
}

type User

type User struct {
	Id       string
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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