controllers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexController

func IndexController(ctx *fasthttp.RequestCtx)

func SendMultipleToChannel

func SendMultipleToChannel(ctx *fasthttp.RequestCtx)

SendMultipleToChannel is tasked with handling all the multiple log insertion requests. It will simply send a response code 503 (service unavailable) if server shut down has already been requested. Response code 400 will be returned in case request body is empty. It will unmarshal the request body and compare the structure with structure of BarkLog struct slice. Finally, it will spawn a go routine to send the logs to LogChannel and will respond with 200 to the client.

func SendSingleToChannel

func SendSingleToChannel(ctx *fasthttp.RequestCtx)

SendSingleToChannel is tasked with handling all the single log insertion requests. It will simply send a response code 503 (service unavailable) if server shut down has already been requested. Response code 400 will be returned in case request body is empty. It will unmarshal the request body and compare the structure with structure of BarkLog struct. Finally, it will spawn a go routine to send the log to LogChannel and will respond with 200 to the client.

func ShutdownService

func ShutdownService(ctx *fasthttp.RequestCtx)

ShutdownService will set the value of global variable `ShutdownRequested` to true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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