server

package
v0.0.0-...-4165c6e Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(userToken root.UserToken, config configuration.Configuration, exp int64) string

---- CreateToken ----

func DecodeJWT

func DecodeJWT(curToken string, config configuration.Configuration) root.UserToken

---- DecodeJWT ----

func GetIpAddress

func GetIpAddress(r *http.Request) string

---- GetIpAddress ----

func HandleOptionsRequest

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

---- HandleOptionsRequest ----

func NewAuthRouter

func NewAuthRouter(router *mux.Router, config configuration.Configuration, dbClient *mongo.Client, authService root.AuthService) *mux.Router

---- NewAuthRouter ----

func NewPermissionRouter

func NewPermissionRouter(router *mux.Router, config configuration.Configuration, dbClient *mongo.Client, permissionService root.PermissionService) *mux.Router

---- NewUserRouter ----

func NewRolePermissionRouter

func NewRolePermissionRouter(router *mux.Router, config configuration.Configuration, dbClient *mongo.Client, rolePermissionService root.RolePermissionService) *mux.Router

---- NewUserRouter ----

func NewRoleRouter

func NewRoleRouter(router *mux.Router, config configuration.Configuration, dbClient *mongo.Client, roleService root.RoleService) *mux.Router

---- NewUserRouter ----

func NewUserRouter

func NewUserRouter(router *mux.Router, config configuration.Configuration, dbClient *mongo.Client, userService root.UserService) *mux.Router

---- NewUserRouter ----

func SetResponseHeaders

func SetResponseHeaders(w http.ResponseWriter, authToken string, apiKey string) http.ResponseWriter

---- SetResponseHeaders ----

func VerifyToken

func VerifyToken(next http.HandlerFunc, config configuration.Configuration, dbClient *mongo.Client) http.HandlerFunc

---- VerifyToken ----

Types

type JWTError

type JWTError struct {
	Message string `json:"message"`
}

--- JWTError ----

type Server

type Server struct {
	Router                *mux.Router
	Config                configuration.Configuration
	DbClient              *mongo.Client
	AuthService           root.AuthService
	UserService           root.UserService
	RoleService           root.RoleService
	PermissionService     root.PermissionService
	RolePermissionService root.RolePermissionService
}

---- Server Struct ----

func NewServer

func NewServer(config configuration.Configuration, dbClient *mongo.Client, auth root.AuthService, user root.UserService, role root.RoleService, permission root.PermissionService, rolePermission root.RolePermissionService) *Server

--- NewServer ----

func (*Server) Init

func (rcvr *Server) Init()

---- Server.Init ----

func (*Server) Start

func (rcvr *Server) Start()

---- Server.Start ----

Jump to

Keyboard shortcuts

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