mirror of
https://github.com/openfaas/faas.git
synced 2025-06-23 23:33:25 +00:00
Update vendor
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/default_enc.go
generated
vendored
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/default_enc.go
generated
vendored
@ -26,6 +26,8 @@ import (
|
||||
// turn numbers into appropriate strings that can be decoded. It will also
|
||||
// properly encoded and decode bools. If will encode a struct, but if you want
|
||||
// to properly handle structures you should use JsonEncoder.
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
type DefaultEncoder struct {
|
||||
// Empty
|
||||
}
|
||||
@ -35,6 +37,8 @@ var falseB = []byte("false")
|
||||
var nilB = []byte("")
|
||||
|
||||
// Encode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (je *DefaultEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
switch arg := v.(type) {
|
||||
case string:
|
||||
@ -58,6 +62,8 @@ func (je *DefaultEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
}
|
||||
|
||||
// Decode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (je *DefaultEncoder) Decode(subject string, data []byte, vPtr any) error {
|
||||
// Figure out what it's pointing to...
|
||||
sData := *(*string)(unsafe.Pointer(&data))
|
||||
|
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/gob_enc.go
generated
vendored
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/gob_enc.go
generated
vendored
@ -21,6 +21,8 @@ import (
|
||||
// GobEncoder is a Go specific GOB Encoder implementation for EncodedConn.
|
||||
// This encoder will use the builtin encoding/gob to Marshal
|
||||
// and Unmarshal most types, including structs.
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
type GobEncoder struct {
|
||||
// Empty
|
||||
}
|
||||
@ -28,6 +30,8 @@ type GobEncoder struct {
|
||||
// FIXME(dlc) - This could probably be more efficient.
|
||||
|
||||
// Encode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (ge *GobEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
b := new(bytes.Buffer)
|
||||
enc := gob.NewEncoder(b)
|
||||
@ -38,6 +42,8 @@ func (ge *GobEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
}
|
||||
|
||||
// Decode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (ge *GobEncoder) Decode(subject string, data []byte, vPtr any) (err error) {
|
||||
dec := gob.NewDecoder(bytes.NewBuffer(data))
|
||||
err = dec.Decode(vPtr)
|
||||
|
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/json_enc.go
generated
vendored
6
gateway/vendor/github.com/nats-io/nats.go/encoders/builtin/json_enc.go
generated
vendored
@ -21,11 +21,15 @@ import (
|
||||
// JsonEncoder is a JSON Encoder implementation for EncodedConn.
|
||||
// This encoder will use the builtin encoding/json to Marshal
|
||||
// and Unmarshal most types, including structs.
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
type JsonEncoder struct {
|
||||
// Empty
|
||||
}
|
||||
|
||||
// Encode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (je *JsonEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
b, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
@ -35,6 +39,8 @@ func (je *JsonEncoder) Encode(subject string, v any) ([]byte, error) {
|
||||
}
|
||||
|
||||
// Decode
|
||||
//
|
||||
// Deprecated: Encoded connections are no longer supported.
|
||||
func (je *JsonEncoder) Decode(subject string, data []byte, vPtr any) (err error) {
|
||||
switch arg := vPtr.(type) {
|
||||
case *string:
|
||||
|
Reference in New Issue
Block a user