handler

package
v0.0.0-...-f2c6537 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ID               = "id"
	FILENAME         = "filename"
	CONTENT_TYPE     = "Content-Type"
	APPLICATION_JSON = "application/json"
	IMAGE_JPEG       = "image/jpeg"
)
View Source
const FORM_DATA_NAME = "file"

Our frontend appends a file and sets the form data name to `file`. It's the most commonly used name for form data.

View Source
const (
	IMAGES_DIRECTORY_PATH = "./images"
)

Variables

This section is empty.

Functions

func Auth

func Auth(c *config.Config) http.HandlerFunc

`/auth` GET route.

func CreateEvent

func CreateEvent(client *http.Client, c *config.Config) http.HandlerFunc

`/events` POST route. It's a protected route. It communicates with the event service only.

func CreateSession

func CreateSession(client *http.Client, c *config.Config) http.HandlerFunc

`/sessions` POST route. It's a protected route. It communicates with the session service only.

func CreateSpeaker

func CreateSpeaker(client *http.Client, c *config.Config) http.HandlerFunc

`/speakers` POST route. It's a protected route. It communicates with the speakers service only.

func DeleteEventById

func DeleteEventById(client *http.Client, c *config.Config) http.HandlerFunc

`/events/{id}` DELETE route. It's a protected route. It communicates with the event service only.

func DeleteSessionById

func DeleteSessionById(client *http.Client, c *config.Config) http.HandlerFunc

`/sessions/{id}` DELETE route. It's a protected route. It communicates with the session service only.

func DeleteSpeakerById

func DeleteSpeakerById(client *http.Client, c *config.Config) http.HandlerFunc

`/speakers/{id}` DELETE route. It's a protected route. It communicates with the speaker service only.

func EditEventById

func EditEventById(client *http.Client, c *config.Config) http.HandlerFunc

`/events/{id}` PUT route. It's a protected route. It communicates with the event service only.

func EditSessionById

func EditSessionById(client *http.Client, c *config.Config) http.HandlerFunc

`/sessions/{id}` PUT route. It's a protected route. It communicates with the session service only.

func EditSpeakerById

func EditSpeakerById(client *http.Client, c *config.Config) http.HandlerFunc

`/speakers/{id}` PUT route. It's a protected route. It communicates with the speaker service only.

func GetAllEvents

func GetAllEvents(client *http.Client, c *config.Config) http.HandlerFunc

`/events` GET route. It communicates with the event service only.

func GetAllSessions

func GetAllSessions(client *http.Client, c *config.Config) http.HandlerFunc

`/sessions` GET route. It communicates with the session service only.

func GetAllSpeakers

func GetAllSpeakers(client *http.Client, c *config.Config) http.HandlerFunc

`/speakers` GET route. It communicates with the speaker service only.

func GetEventById

func GetEventById(client *http.Client, c *config.Config) http.HandlerFunc

`/events/{id}` GET route. It communicates with the event service only.

func GetImageByFilename

func GetImageByFilename(c *config.Config) http.HandlerFunc

`/images/{filename}` GET route. It doesn't communicate with the database or any of the services. It retrieves the images from the filesystem (`event/images`).

func GetSessionById

func GetSessionById(client *http.Client, c *config.Config) http.HandlerFunc

`/sessions/{id}` GET route. It communicates with the session service only.

func GetSpeakerById

func GetSpeakerById(client *http.Client, c *config.Config) http.HandlerFunc

`/speakers/{id}` GET route. It communicates with the speaker service only.

func SignIn

func SignIn(client *http.Client, c *config.Config) http.HandlerFunc

`/auth/sign-in` POST route. It communicates with the auth service only.

func SignOut

func SignOut(c *config.Config) http.HandlerFunc

`/auth/sign-out` POST route. It communicates with the auth service only.

func UploadImage

func UploadImage(c *config.Config) http.HandlerFunc

`/images` POST route. It doesn't communicate with the database or any of the services. It stores the image in the filesystem (`event/images`).

Types

This section is empty.

Jump to

Keyboard shortcuts

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