goserver

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: GPL-3.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncAreWeHealthy

type FuncAreWeHealthy func(msg string) bool

type FuncAreWeReady

type FuncAreWeReady func(msg string) bool

type GoHttpServer

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

GoHttpServer is a struct type to store information related to all handlers of web server

func NewGoHttpServer

func NewGoHttpServer(listenAddress string, l golog.MyLogger, webRootDir string, content embed.FS, restrictedUrl string) *GoHttpServer

NewGoHttpServer is a constructor that initializes the server,routes and all fields in GoHttpServer type

func (*GoHttpServer) AddGetRoute

func (s *GoHttpServer) AddGetRoute(baseURL string, urlPath string, handler echo.HandlerFunc)

AddGetRoute adds a handler for this web server

func (*GoHttpServer) GetEcho

func (s *GoHttpServer) GetEcho() *echo.Echo

GetEcho returns a pointer to the Echo reference

func (*GoHttpServer) GetHealthHandler

func (s *GoHttpServer) GetHealthHandler(healthyFunc FuncAreWeHealthy, msg string) echo.HandlerFunc

func (*GoHttpServer) GetReadinessHandler

func (s *GoHttpServer) GetReadinessHandler(readyFunc FuncAreWeReady, msg string) echo.HandlerFunc

func (*GoHttpServer) GetRestrictedGroup

func (s *GoHttpServer) GetRestrictedGroup() *echo.Group

GetRestrictedGroup adds a handler for this web server

func (*GoHttpServer) StartServer

func (s *GoHttpServer) StartServer() error

StartServer initializes all the handlers paths of this web server, it is called inside the NewGoHttpServer constructor

type JwtCustomClaims

type JwtCustomClaims struct {
	jwt.RegisteredClaims
	Id       int32  `json:"id"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"username"`
	IsAdmin  bool   `json:"is_admin"`
}

JwtCustomClaims are custom claims extending default ones.

Jump to

Keyboard shortcuts

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