adapters

package
v0.0.0-...-e173b71 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySQLConnection

func NewMySQLConnection() (*sqlx.DB, error)

Types

type MySQLTrainingsRepository

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

func NewMySQLTrainingsRepository

func NewMySQLTrainingsRepository(db *sqlx.DB) MySQLTrainingsRepository

func (MySQLTrainingsRepository) AddTraining

func (MySQLTrainingsRepository) AllTrainings

func (r MySQLTrainingsRepository) AllTrainings(ctx context.Context) ([]query.Training, error)

func (MySQLTrainingsRepository) FindTrainingsForUser

func (r MySQLTrainingsRepository) FindTrainingsForUser(ctx context.Context, userUUID string) ([]query.Training, error)

func (MySQLTrainingsRepository) GetTraining

func (r MySQLTrainingsRepository) GetTraining(
	ctx context.Context,
	trainingUUID string,
	user training.User,
) (*training.Training, error)

func (MySQLTrainingsRepository) RemoveAllTrainings

func (r MySQLTrainingsRepository) RemoveAllTrainings(ctx context.Context) error

RemoveAllTrainings was designed for tests for doing data cleanups

func (MySQLTrainingsRepository) UpdateTraining

func (r MySQLTrainingsRepository) UpdateTraining(
	ctx context.Context,
	trainingUUID string,
	user training.User,
	updateFn func(ctx context.Context, tr *training.Training) (*training.Training, error)) error

type TrainerGrpc

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

func NewTrainerGrpc

func NewTrainerGrpc(client trainer.TrainerServiceClient) TrainerGrpc

func (TrainerGrpc) CancelTraining

func (s TrainerGrpc) CancelTraining(ctx context.Context, trainingTime time.Time) error

func (TrainerGrpc) MoveTraining

func (s TrainerGrpc) MoveTraining(
	ctx context.Context,
	newTime time.Time,
	originalTrainingTime time.Time,
) error

func (TrainerGrpc) ScheduleTraining

func (s TrainerGrpc) ScheduleTraining(ctx context.Context, trainingTime time.Time) error

type UsersGrpc

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

func NewUsersGrpc

func NewUsersGrpc(client users.UsersServiceClient) UsersGrpc

func (UsersGrpc) UpdateTrainingBalance

func (s UsersGrpc) UpdateTrainingBalance(ctx context.Context, userID string, amountChange int) error

Jump to

Keyboard shortcuts

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