handlers

package
v0.0.0-...-f3c68be Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT() (string, error)

GenerateJWT generates JWT Token

Types

type AuthHandler

type AuthHandler struct {
}

AuthHandler handles all the operations related to the JWT Tokens

func NewMiddlewareHandler

func NewMiddlewareHandler() *AuthHandler

NewMiddlewareHandler returns a new instance of the middleware Handler

func (*AuthHandler) ContextMiddleware

func (handler *AuthHandler) ContextMiddleware(ctx context.Context, next http.Handler) http.Handler

ContextMiddleware handles context across the layers

func (*AuthHandler) GenerateToken

func (handler *AuthHandler) GenerateToken(w http.ResponseWriter, r *http.Request)

GenerateToken generates a new JWT Token

func (*AuthHandler) IPFIlterMiddleware

func (handler *AuthHandler) IPFIlterMiddleware(h http.Handler) http.Handler

IPFIlterMiddleware ...

type CompaniesHandler

type CompaniesHandler struct {
	CompanyService services.DatabaseServicesIface
	KafkaService   kafka.IKafka
}

CompaniesHandler is the class implementation for HandlerIface Interface

func (*CompaniesHandler) DeleteCompanyDetails

func (handler *CompaniesHandler) DeleteCompanyDetails(w http.ResponseWriter, r *http.Request)

DeleteCompanyDetails ....

func (*CompaniesHandler) GetCompanyDetails

func (handler *CompaniesHandler) GetCompanyDetails(w http.ResponseWriter, r *http.Request)

GetCompanyDetails gets the company details based on filter

func (*CompaniesHandler) ListAllCompanies

func (handler *CompaniesHandler) ListAllCompanies(w http.ResponseWriter, r *http.Request)

ListAllCompanies list details about all companies

func (*CompaniesHandler) PostCompany

func (handler *CompaniesHandler) PostCompany(w http.ResponseWriter, r *http.Request)

PostCompany creates the company data

func (*CompaniesHandler) PutCompanyDetails

func (handler *CompaniesHandler) PutCompanyDetails(w http.ResponseWriter, r *http.Request)

PutCompanyDetails ...

type HandlerIface

type HandlerIface interface {
	PostCompany(w http.ResponseWriter, r *http.Request)
	ListAllCompanies(w http.ResponseWriter, r *http.Request)
	GetCompanyDetails(w http.ResponseWriter, r *http.Request)
	PutCompanyDetails(w http.ResponseWriter, r *http.Request)
	DeleteCompanyDetails(w http.ResponseWriter, r *http.Request)
}

HandlerIface provides the interface for handling the product related

func NewCompaniesHandler

func NewCompaniesHandler(dbService *services.DatabaseService, kafka kafka.IKafka) HandlerIface

NewCompaniesHandler instantiates the struct

type MiddlewareIface

type MiddlewareIface interface {
	GenerateToken(w http.ResponseWriter, r *http.Request)
}

MiddlewareIface abstracts the functionlities on all middleware handler

Jump to

Keyboard shortcuts

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