mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 21:26:31 +00:00
Rename Makefile targets
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
16
gateway/vendor/github.com/nats-io/nats.go/enc.go
generated
vendored
16
gateway/vendor/github.com/nats-io/nats.go/enc.go
generated
vendored
@ -26,8 +26,8 @@ import (
|
||||
|
||||
// Encoder interface is for all register encoders
|
||||
type Encoder interface {
|
||||
Encode(subject string, v interface{}) ([]byte, error)
|
||||
Decode(subject string, data []byte, vPtr interface{}) error
|
||||
Encode(subject string, v any) ([]byte, error)
|
||||
Decode(subject string, data []byte, vPtr any) error
|
||||
}
|
||||
|
||||
var encMap map[string]Encoder
|
||||
@ -88,7 +88,7 @@ func EncoderForType(encType string) Encoder {
|
||||
|
||||
// Publish publishes the data argument to the given subject. The data argument
|
||||
// will be encoded using the associated encoder.
|
||||
func (c *EncodedConn) Publish(subject string, v interface{}) error {
|
||||
func (c *EncodedConn) Publish(subject string, v any) error {
|
||||
b, err := c.Enc.Encode(subject, v)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -99,7 +99,7 @@ func (c *EncodedConn) Publish(subject string, v interface{}) error {
|
||||
// PublishRequest will perform a Publish() expecting a response on the
|
||||
// reply subject. Use Request() for automatically waiting for a response
|
||||
// inline.
|
||||
func (c *EncodedConn) PublishRequest(subject, reply string, v interface{}) error {
|
||||
func (c *EncodedConn) PublishRequest(subject, reply string, v any) error {
|
||||
b, err := c.Enc.Encode(subject, v)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -110,7 +110,7 @@ func (c *EncodedConn) PublishRequest(subject, reply string, v interface{}) error
|
||||
// Request will create an Inbox and perform a Request() call
|
||||
// with the Inbox reply for the data v. A response will be
|
||||
// decoded into the vPtr Response.
|
||||
func (c *EncodedConn) Request(subject string, v interface{}, vPtr interface{}, timeout time.Duration) error {
|
||||
func (c *EncodedConn) Request(subject string, v any, vPtr any, timeout time.Duration) error {
|
||||
b, err := c.Enc.Encode(subject, v)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -129,7 +129,7 @@ func (c *EncodedConn) Request(subject string, v interface{}, vPtr interface{}, t
|
||||
}
|
||||
|
||||
// Handler is a specific callback used for Subscribe. It is generalized to
|
||||
// an interface{}, but we will discover its format and arguments at runtime
|
||||
// an any, but we will discover its format and arguments at runtime
|
||||
// and perform the correct callback, including demarshaling encoded data
|
||||
// back into the appropriate struct based on the signature of the Handler.
|
||||
//
|
||||
@ -150,7 +150,7 @@ func (c *EncodedConn) Request(subject string, v interface{}, vPtr interface{}, t
|
||||
// and demarshal it into the given struct, e.g. person.
|
||||
// There are also variants where the callback wants either the subject, or the
|
||||
// subject and the reply subject.
|
||||
type Handler interface{}
|
||||
type Handler any
|
||||
|
||||
// Dissect the cb Handler's signature
|
||||
func argInfo(cb Handler) (reflect.Type, int) {
|
||||
@ -265,5 +265,5 @@ func (c *EncodedConn) Drain() error {
|
||||
|
||||
// LastError reports the last error encountered via the Connection.
|
||||
func (c *EncodedConn) LastError() error {
|
||||
return c.Conn.err
|
||||
return c.Conn.LastError()
|
||||
}
|
||||
|
Reference in New Issue
Block a user