db

package
v0.0.0-...-77bc736 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAccount

type AdminAccount struct {
	ID           int64
	Email        string
	PasswordHash string
}

type CreateAdminAccountParams

type CreateAdminAccountParams struct {
	Email        string
	PasswordHash string
}

type CreateEmployerAccountParams

type CreateEmployerAccountParams struct {
	Email        string
	PasswordHash string
	EmployerID   int64
}

type CreateJobPostParams

type CreateJobPostParams struct {
	Title      string
	Content    string
	CreatedAt  string
	Status     string
	EmployerID int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteEmployerAccountParams

type DeleteEmployerAccountParams struct {
	EmployerID int64
	ID         int64
}

type Employer

type Employer struct {
	ID   int64
	Name string
}

type EmployerAccount

type EmployerAccount struct {
	ID           int64
	Email        string
	PasswordHash string
	EmployerID   int64
}

type GetEmployerAccountParams

type GetEmployerAccountParams struct {
	EmployerID int64
	ID         int64
}

type JobPost

type JobPost struct {
	ID         int64
	Title      string
	Content    string
	CreatedAt  string
	Status     string
	EmployerID int64
}

type Queries

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

func Initialize

func Initialize(dbPath string) (*Queries, error)

func New

func New(db DBTX) *Queries

func (*Queries) CreateAdminAccount

func (q *Queries) CreateAdminAccount(ctx context.Context, arg CreateAdminAccountParams) (AdminAccount, error)

func (*Queries) CreateEmployer

func (q *Queries) CreateEmployer(ctx context.Context, name string) (Employer, error)

func (*Queries) CreateEmployerAccount

func (q *Queries) CreateEmployerAccount(ctx context.Context, arg CreateEmployerAccountParams) (EmployerAccount, error)

func (*Queries) CreateJobPost

func (q *Queries) CreateJobPost(ctx context.Context, arg CreateJobPostParams) (JobPost, error)

func (*Queries) DeleteAdminAccount

func (q *Queries) DeleteAdminAccount(ctx context.Context, id int64) error

func (*Queries) DeleteEmployer

func (q *Queries) DeleteEmployer(ctx context.Context, id int64) error

func (*Queries) DeleteEmployerAccount

func (q *Queries) DeleteEmployerAccount(ctx context.Context, arg DeleteEmployerAccountParams) error

func (*Queries) DeleteJobPost

func (q *Queries) DeleteJobPost(ctx context.Context, id int64) error

func (*Queries) GetAdminAccount

func (q *Queries) GetAdminAccount(ctx context.Context, id int64) (AdminAccount, error)

func (*Queries) GetAdminAccountByEmail

func (q *Queries) GetAdminAccountByEmail(ctx context.Context, email string) (AdminAccount, error)

func (*Queries) GetEmployer

func (q *Queries) GetEmployer(ctx context.Context, id int64) (Employer, error)

func (*Queries) GetEmployerAccount

func (q *Queries) GetEmployerAccount(ctx context.Context, arg GetEmployerAccountParams) (EmployerAccount, error)

func (*Queries) GetEmployerAccountByEmail

func (q *Queries) GetEmployerAccountByEmail(ctx context.Context, email string) (EmployerAccount, error)

func (*Queries) GetJobPost

func (q *Queries) GetJobPost(ctx context.Context, id int64) (JobPost, error)

func (*Queries) ListAdminAccounts

func (q *Queries) ListAdminAccounts(ctx context.Context) ([]AdminAccount, error)

func (*Queries) ListEmployerAccounts

func (q *Queries) ListEmployerAccounts(ctx context.Context, employerID int64) ([]EmployerAccount, error)

func (*Queries) ListEmployers

func (q *Queries) ListEmployers(ctx context.Context) ([]Employer, error)

func (*Queries) ListJobPosts

func (q *Queries) ListJobPosts(ctx context.Context) ([]JobPost, error)

func (*Queries) ListJobPostsByAccount

func (q *Queries) ListJobPostsByAccount(ctx context.Context, employerID int64) ([]JobPost, error)

func (*Queries) NumAdminAccounts

func (q *Queries) NumAdminAccounts(ctx context.Context) (int64, error)

func (*Queries) NumEmployerAccounts

func (q *Queries) NumEmployerAccounts(ctx context.Context) (int64, error)

func (*Queries) NumEmployers

func (q *Queries) NumEmployers(ctx context.Context) (int64, error)

func (*Queries) UpdateAdminAccount

func (q *Queries) UpdateAdminAccount(ctx context.Context, arg UpdateAdminAccountParams) error

func (*Queries) UpdateEmployer

func (q *Queries) UpdateEmployer(ctx context.Context, arg UpdateEmployerParams) error

func (*Queries) UpdateEmployerAccount

func (q *Queries) UpdateEmployerAccount(ctx context.Context, arg UpdateEmployerAccountParams) error

func (*Queries) UpdateJobPost

func (q *Queries) UpdateJobPost(ctx context.Context, arg UpdateJobPostParams) error

func (*Queries) WithTx

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

type UpdateAdminAccountParams

type UpdateAdminAccountParams struct {
	PasswordHash string
	ID           int64
}

type UpdateEmployerAccountParams

type UpdateEmployerAccountParams struct {
	PasswordHash string
	ID           int64
}

type UpdateEmployerParams

type UpdateEmployerParams struct {
	Name string
	ID   int64
}

type UpdateJobPostParams

type UpdateJobPostParams struct {
	Title   string
	Content string
	Status  string
	ID      int64
}

Jump to

Keyboard shortcuts

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