gin

package
v0.0.0-...-0bfac37 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port string
}

Config currently only stores the port but could contain other things beneficial to the server

type Server

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

Server holds the Config (thus containing the port) and the Gin Engine the server runs

func NewServer

func NewServer(cfg *Config, storage storage.Storage) *Server

NewServer instantiates the server with the config loaded in main.go It also sets up router groups and paths to actions

func (Server) CreationHandler

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

CreationHandler creates new users

func (Server) DeleteHandler

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

DeleteHandler soft delete users

func (Server) ListHandler

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

ListHandler creates new users

func (Server) ReadyHandler

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

ReadyHandler basic db ping check

func (Server) Run

func (s Server) Run() error

Run the server, if this fails, return an error

func (Server) UpdateHandler

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

UpdateHandler updates existing users

Jump to

Keyboard shortcuts

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