repo

package
v0.0.0-...-9a05c17 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MentorRepository

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

func NewMentorRepo

func NewMentorRepo(logger *zap.Logger, db *db.PgDb) *MentorRepository

func (*MentorRepository) CreateMentor

func (m *MentorRepository) CreateMentor(ctx context.Context, tx *sqlx.Tx, name string) error

func (*MentorRepository) DeleteMentor

func (m *MentorRepository) DeleteMentor(ctx context.Context, tx *sqlx.Tx, id int) error

func (*MentorRepository) GetMentor

func (m *MentorRepository) GetMentor(ctx context.Context, id int) (model.Mentor, error)

func (*MentorRepository) RunInTx

func (m *MentorRepository) RunInTx(ctx context.Context, fn func(*sqlx.Tx) error) error

func (*MentorRepository) UpdateMentor

func (m *MentorRepository) UpdateMentor(ctx context.Context, tx *sqlx.Tx, mentor model.Mentor) error

type StudentRepo

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

Stores Student Info

func NewStudentRepo

func NewStudentRepo(logger *zap.Logger, db *db.PgDb) *StudentRepo

func (*StudentRepo) CreateNewStudent

func (r *StudentRepo) CreateNewStudent(ctx context.Context, tx *sqlx.Tx, name string, role string) error

Create A New Student

func (*StudentRepo) DeleteStudent

func (r *StudentRepo) DeleteStudent(ctx context.Context, tx *sqlx.Tx, id int) error

Delete a Student

func (*StudentRepo) GetStudent

func (r *StudentRepo) GetStudent(ctx context.Context, id int) (model.Student, error)

Get Student, Without TX

func (*StudentRepo) RunInTx

func (r *StudentRepo) RunInTx(ctx context.Context, fn func(*sqlx.Tx) error) error

Run In Tx

func (*StudentRepo) UpdateStudent

func (r *StudentRepo) UpdateStudent(ctx context.Context, tx *sqlx.Tx, student model.Student) error

Jump to

Keyboard shortcuts

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