engine: Fix up some send/recv corner cases
Initially I wasn't 100% clear or decided on the send/recv semantics. After some experimenting, I think this is much closer to what we want. Nothing should break or regress here, this only enables more possibilities.
This commit is contained in:
@@ -89,7 +89,6 @@ type HTTPProxyRes struct {
|
||||
traits.Base // add the base methods without re-implementation
|
||||
traits.Edgeable // XXX: add autoedge support
|
||||
traits.Groupable // can be grouped into HTTPServerRes
|
||||
traits.Sendable
|
||||
|
||||
init *engine.Init
|
||||
|
||||
@@ -520,20 +519,6 @@ func (obj *HTTPProxyRes) Cmp(r engine.Res) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// HTTPProxySends is the struct of data which is sent after a successful Apply.
|
||||
type HTTPProxySends struct {
|
||||
// Data is the received value being sent.
|
||||
// TODO: should this be []byte or *[]byte instead?
|
||||
Data *string `lang:"data"`
|
||||
}
|
||||
|
||||
// Sends represents the default struct of values we can send using Send/Recv.
|
||||
func (obj *HTTPProxyRes) Sends() interface{} {
|
||||
return &HTTPProxySends{
|
||||
Data: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalYAML is the custom unmarshal handler for this struct. It is
|
||||
// primarily useful for setting the defaults.
|
||||
func (obj *HTTPProxyRes) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
|
||||
Reference in New Issue
Block a user