package builtin
import "github.com/nats-io/nats.go/encoders/builtin"
Index ¶
- type DefaultEncoder
- func (je *DefaultEncoder) Decode(subject string, data []byte, vPtr any) error
- func (je *DefaultEncoder) Encode(subject string, v any) ([]byte, error)
- type GobEncoder
- func (ge *GobEncoder) Decode(subject string, data []byte, vPtr any) (err error)
- func (ge *GobEncoder) Encode(subject string, v any) ([]byte, error)
- type JsonEncoder
Types ¶
type DefaultEncoder ¶
type DefaultEncoder struct { }
DefaultEncoder implementation for EncodedConn. This encoder will leave []byte and string untouched, but will attempt to 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.
func (*DefaultEncoder) Decode ¶
func (je *DefaultEncoder) Decode(subject string, data []byte, vPtr any) error
Decode
Deprecated: Encoded connections are no longer supported.
func (*DefaultEncoder) Encode ¶
func (je *DefaultEncoder) Encode(subject string, v any) ([]byte, error)
Encode
Deprecated: Encoded connections are no longer supported.
type GobEncoder ¶
type GobEncoder struct { }
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.
func (*GobEncoder) Decode ¶
func (ge *GobEncoder) Decode(subject string, data []byte, vPtr any) (err error)
Decode
Deprecated: Encoded connections are no longer supported.
func (*GobEncoder) Encode ¶
func (ge *GobEncoder) Encode(subject string, v any) ([]byte, error)
Encode
Deprecated: Encoded connections are no longer supported.
type JsonEncoder ¶
type JsonEncoder struct { }
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.
func (*JsonEncoder) Decode ¶
func (je *JsonEncoder) Decode(subject string, data []byte, vPtr any) (err error)
Decode
Deprecated: Encoded connections are no longer supported.
func (*JsonEncoder) Encode ¶
func (je *JsonEncoder) Encode(subject string, v any) ([]byte, error)
Encode
Deprecated: Encoded connections are no longer supported.
Source Files ¶
default_enc.go gob_enc.go json_enc.go
- Version
- v1.41.2 (latest)
- Published
- Apr 17, 2025
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 2 days ago –
Tools for package owners.