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

defines the method to customize http server #2171

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

sniperwzq
Copy link
Contributor

单体服务部署时需要支持热更新,一些开源方案如overseer等需要使用http Serve,gozero的internal.StartHttp是支持StartOption的,但是Server Start不支持设置,发起pr支持start时自定义StartOption

@kevwan
Copy link
Contributor

kevwan commented Jul 23, 2022

It doesn't work, because Start(...StartOption) doesn't meet the Service interface.

So the server cannot be added into a ServiceGroup.

I think you can use RunOption to achieve that.

@sniperwzq
Copy link
Contributor Author

sniperwzq commented Jul 25, 2022

It doesn't work, because Start(...StartOption) doesn't meet the Service interface.

So the server cannot be added into a ServiceGroup.

I think you can use RunOption to achieve that.

不能用RunOption, server.Start时才创建了http.Server, rest.RunOption在MustNewServer的时候就调用了; 需求是让api的http server能接受另一个 net.Listener, 类似 svr.ListenAndServe要Serve一下
image

@kevwan
Copy link
Contributor

kevwan commented Jan 7, 2023

Would you please add unit tests?

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2023

Codecov Report

Merging #2171 (4e1c957) into master (211b949) will decrease coverage by 0.07%.
The diff coverage is 26.66%.

Impacted Files Coverage Δ
rest/engine.go 92.07% <11.11%> (-1.24%) ⬇️
rest/server.go 94.85% <50.00%> (-1.64%) ⬇️

... and 3 files with indirect coverage changes

@kevwan kevwan merged commit 3e093bf into zeromicro:master Mar 11, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants