server

package
v0.0.0-...-e03e17b Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_BAD_REQUEST_BODY = "Bad request body"

	INVALID_CREDENTIALS = "Invalid credentials"
)

Variables

View Source
var API_VERSION = 1

Functions

func ClaimGetID

func ClaimGetID(c interface{}) (uint, error)

ClaimGetID - extract id from jwt token claim

func ClaimGetUsername

func ClaimGetUsername(c interface{}) (string, error)

ClaimGetUsername - extract username from jwt token claim

Types

type Server

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

goAuht http web server

func New

func New(host string, port int, debug *debugger.Debugger, db *gorm.DB) *Server

create new server

func (*Server) AuthRoutes

func (s *Server) AuthRoutes(r *mux.Router)

func (*Server) LoginController

func (s *Server) LoginController(w http.ResponseWriter, r *http.Request)

handle login to server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP()

serve http for our API server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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