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
Serverless zanzibar #676
Serverless zanzibar #676
Conversation
… without a downstream, to echo the response back and use a new serverless middleware
… without a downstream, to echo the response back and use a new serverless middleware
codegen/method.go
Outdated
*compile.DoubleSpec, | ||
*compile.StringSpec: | ||
|
||
dummyConverter.append("out", " := in\t\n") |
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.
isn't this just "out := in\n"
There is no point in having a trailing \t
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.
lgtm. But please ask rohit.patali to review as well.
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.
I would like to see at least one example each for the following cases:
- no request/response payload
- primitive type request/response payload
examples/example-gateway/endpoints/serverless/serverless-empty.yaml
Outdated
Show resolved
Hide resolved
examples/example-gateway/endpoints/serverless/serverless-empty.yaml
Outdated
Show resolved
Hide resolved
@@ -275,6 +279,8 @@ type EndpointSpec struct { | |||
ClientMethod string `yaml:"clientMethod,omitempty"` | |||
// The client for this endpoint if httpClient or tchannelClient | |||
ClientSpec *ClientSpec `yaml:"-"` | |||
// DummyEndpoint checks if the endpoint is serverless | |||
IsDummyEndpoint bool `yaml:"-"` |
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.
call it clientless and other places throughout the code.
@@ -1000,6 +1003,61 @@ func (ms *MethodSpec) setTypeConverters( | |||
return nil | |||
} | |||
|
|||
func (ms *MethodSpec) setDummyTypeConverters( |
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.
call it ClientLessConverter
examples/example-gateway/endpoints/serverless/serverless-empty.yaml
Outdated
Show resolved
Hide resolved
This is a clientless feature and not a serverless. server has a standard meaning and lets not change it. server is in this case zanzibar. |
|
||
{{with .Method -}} | ||
// {{$workflowInterface}} defines the interface for {{$serviceMethod}} workflow | ||
type {{$workflowInterface}} interface { |
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.
This interface should not be redeclared, it should be common b/w various workflows. program to interface and not to implementation.
Adds a new feature in Zanzibar to have a serverless mode. Endpoints can be created without a downstream, the workflow is short-circuited together to return a response to the caller. A new type convertor flow was added to convert Request to Response type, which is used by the serverless middleware.