Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add self-created middleware to the addDefaultEndpointMiddleware automaticly #18

Closed
GrantZheng opened this issue Nov 5, 2018 · 1 comment

Comments

@GrantZheng
Copy link

GrantZheng commented Nov 5, 2018

Hi, like the title, how to add self-created middleware to the addDefaultEndpointMiddleware function automaticly,l like the InstrumentingMiddleware and the LoggingMiddleware?
thanks

@kujtimiihoxha
Copy link
Owner

The only way you can add self created middleware at the moment is to use the getServiceMiddleware function in cmd/service/service.go

func getServiceMiddleware(logger log.Logger) (mw []service.Middleware) {
	mw = []service.Middleware{}
	mw = addDefaultServiceMiddleware(logger, mw)
	// Append your middleware here
	return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants