handler

package
v0.0.0-...-732b81e Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessToCreateCourse   = "course created with success"
	SuccessToGetCourse      = "course found with success"
	ErrorToCreateCourse     = "error to create and process the request"
	ErrorToGetCourse        = "error to get course by id"
	CourseNotFound          = "course with id %d wasn´t found"
	FieldOutlineError       = "Field outline cannot be empty"
	FieldDescriptionError   = "Field description cannot be empty"
	ErrorToGetListOfCourses = "error to get list of courses"
	SuccessToListCourses    = "list of courses retrieved successfully"
)
View Source
const (
	SuccessToCreateStudent = "student created with success"
	SuccessToGetStudent    = "student found with success"
	ErrorToCreateStudent   = "error to create and process the request"
	ErrorToGetStudent      = "error to get student by id"
	StudentNotFound        = "student with id %d wasn´t found"
	// FieldNameError           = "Field name cannot be empty"
	ErrorToGetListOfStudents = "error to get list of students"
	SuccessToListStudents    = "list of students retrieved successfully"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Course

type Course struct {
	CourseService input.ICourseService
	LoggerSugar   *zap.SugaredLogger
}

func (*Course) Create

func (c *Course) Create(w http.ResponseWriter, r *http.Request)

func (*Course) GetByID

func (c *Course) GetByID(w http.ResponseWriter, r *http.Request)

func (*Course) GetCourses

func (c *Course) GetCourses(w http.ResponseWriter, r *http.Request)

type CourseRequest

type CourseRequest struct {
	ID          int64  `json:"id"`
	Description string `json:"description"`
	Outline     string `json:"outline"`
}

type CourseResponse

type CourseResponse struct {
	ID          int64  `json:"id"`
	Description string `json:"description"`
	Outline     string `json:"outline"`
}

type Generic

type Generic struct {
	LoggerSugar *zap.SugaredLogger
}

func (*Generic) HealthCheck

func (h *Generic) HealthCheck(w http.ResponseWriter, r *http.Request)

func (*Generic) NotFound

func (h *Generic) NotFound(w http.ResponseWriter, r *http.Request)

type Student

type Student struct {
	StudentService input.IStudentService
	LoggerSugar    *zap.SugaredLogger
}

func (*Student) Create

func (c *Student) Create(w http.ResponseWriter, r *http.Request)

func (*Student) GetByID

func (c *Student) GetByID(w http.ResponseWriter, r *http.Request)

func (*Student) GetStudents

func (c *Student) GetStudents(w http.ResponseWriter, r *http.Request)

type StudentRequest

type StudentRequest struct {
	ID               int64     `json:"id"`
	Name             string    `json:"name"`
	RegistrationDate time.Time `json:"registration_date"`
}

type StudentResponse

type StudentResponse struct {
	ID               int64     `json:"id"`
	Name             string    `json:"name"`
	RegistrationDate time.Time `json:"registration_date"`
}

Jump to

Keyboard shortcuts

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