server

package
v0.0.0-...-5733152 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataEndpoint string

Functions

This section is empty.

Types

type Server

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

Server is the server based on Gin

func (*Server) Init

func (s *Server) Init() error

Init the Server object and create a Gin server

func (*Server) RouteGetQuote

func (s *Server) RouteGetQuote(c *gin.Context)

RouteGetQuote is the handler for the GET /api/quote request The response contains a random Taylor Swift quote, as served by https://api.taylor.rest/

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start the web server Note this function is blocking, and will return only when the servers are shut down (via context cancelation or via SIGINT/SIGTERM signals)

Jump to

Keyboard shortcuts

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