handler

package
v0.0.0-...-4d7ac9f Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHandler

func AuthHandler(w http.ResponseWriter, r *http.Request)

func GetAllCourses

func GetAllCourses(w http.ResponseWriter, r *http.Request)

func GetAllInstructors

func GetAllInstructors(w http.ResponseWriter, r *http.Request)

func GetAllUsers

func GetAllUsers(w http.ResponseWriter, r *http.Request)

func GetCoursesByID

func GetCoursesByID(w http.ResponseWriter, r *http.Request)

func GetCoursesWithInstructorAndAttendee

func GetCoursesWithInstructorAndAttendee(w http.ResponseWriter, r *http.Request)

func GetInstructorByID

func GetInstructorByID(w http.ResponseWriter, r *http.Request)

func GetUserByID

func GetUserByID(w http.ResponseWriter, r *http.Request)

Types

type Course

type Course struct {
	ID           int      `json:"id"`
	InstructorID int      `json:"instructor_id"`
	Name         string   `json:"name"`
	Topics       []string `json:"topics"`
	Attendees    []int    `json:"attendees"`
}

Course is course being taught

type Instructor

type Instructor struct {
	ID        int      `json:"id"`
	Name      string   `json:"name"`
	Email     string   `json:"email"`
	Company   string   `json:"company"`
	Expertise []string `json:"expertise"`
}

Instructor type represent a instructor for a course

type Server

type Server struct {
	Routes []string `json:"routes"`
}

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type User

type User struct {
	ID        int      `json:"id"`
	Name      string   `json:"name"`
	Email     string   `json:"email"`
	Company   string   `json:"company"`
	Interests []string `json:"interests"`
}

User represent one user of our service

Jump to

Keyboard shortcuts

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