-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: support cwgo generate code && service registry extension #99
Conversation
cc @rogerogers |
} | ||
} | ||
|
||
func resolverConfig() []*survey.Question { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it called a resolver? Most people are more familiar with the term "registry center".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the client side, service resolver maybe better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ca.Registry != consts.Etcd && | ||
ca.Registry != consts.Polaris { | ||
return errors.New("unsupported registry") | ||
if ca.Resolver != "" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不应该使用 || 吗?
假定就是 ||, 我觉得可以把这些 registry consts 写成一个切片, 循环进行比对
pkg/generator/hz_client_tpl.go
Outdated
import "github.com/cloudwego/cwgo/pkg/consts" | ||
|
||
// related to service resolver | ||
var ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实这类文件是 registry 的 tpl 文件, 要不将这类文件的名字改为 hz_client_registry_tpl.go 之类的?
ca8e9bc
to
3c5dd4c
Compare
What type of PR is this?
feat
What this PR does / why we need it (en: English/zh: Chinese):
en: feat: support cwgo generate code && service registry extension
zh:支持 cwgo 生成代码的能力 && 集成 cwgo 服务注册与发现的能力 && 用户可自定义服务注册与发现扩展
Which issue(s) this PR fixes:
#106