rest

package
v0.0.0-...-5f07eeb Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

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

Index returns a welcome message

func NewRouter

func NewRouter() *mux.Router

NewRouter returns a new Router which routes the REST request to the unique Handler

Types

type APIServer

type APIServer struct {
	http.Server
	// contains filtered or unexported fields
}

APIServer Receiver object for API Rest Server

func NewAPIServer

func NewAPIServer(wg *sync.WaitGroup) *APIServer

NewAPIServer provides an instance of APIServer

func (*APIServer) APIShutdownHandler

func (s *APIServer) APIShutdownHandler(w http.ResponseWriter, r *http.Request)

APIShutdownHandler provides shutdown handler for closing the REST Server It also closes the Database.

func (*APIServer) RunAPIServer

func (s *APIServer) RunAPIServer()

RunAPIServer starts the Database and Rest Server

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
	QueryPairs  []string
}

Route defines a unique route for a REST request

type Routes

type Routes []Route

Routes define an array of routes supported by the application

Directories

Path Synopsis
generated
server/go
* Swagger MyApp * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Swagger MyApp * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Jump to

Keyboard shortcuts

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