Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(proto.NewMarshaller), fx.Provide(proto.NewEncoder), fx.Provide(json.NewMarshaller), fx.Provide(json.NewEncoder), fx.Provide(toml.NewMarshaller), fx.Provide(toml.NewEncoder), fx.Provide(yaml.NewMarshaller), fx.Provide(yaml.NewEncoder), fx.Provide(gob.NewMarshaller), fx.Provide(gob.NewEncoder), fx.Provide(NewMarshallerMap), fx.Provide(NewEncoderMap), )
Module for fx.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶ added in v1.282.0
type Encoder interface { // Encode any to a writer. Encode(w io.Writer, e any) error // Decode any from a reader. Decode(r io.Reader, e any) error }
Encoder allows different types of encoding/decoding.
type EncoderMap ¶ added in v1.282.0
type EncoderMap struct {
// contains filtered or unexported fields
}
MarshallerMap of marshaller.
func NewEncoderMap ¶ added in v1.282.0
func NewEncoderMap() *EncoderMap
NewMarshallerMap for marshaller.
func (*EncoderMap) Get ¶ added in v1.282.0
func (f *EncoderMap) Get(kind string) Encoder
Get from kind.
func (*EncoderMap) Register ¶ added in v1.282.0
func (f *EncoderMap) Register(kind string, enc Encoder)
Register kind and encoder.
type Marshaller ¶
type Marshaller interface { // Marshal value. Marshal(v any) ([]byte, error) // Unmarshal data to value. Unmarshal(data []byte, v any) error }
Marshaller allows to have different ways to marshal/unmarshal.
type MarshallerMap ¶ added in v1.282.0
type MarshallerMap struct {
// contains filtered or unexported fields
}
MarshallerMap of marshaller.
func NewMarshallerMap ¶ added in v1.282.0
func NewMarshallerMap() *MarshallerMap
NewMarshallerMap for marshaller.
func (*MarshallerMap) Get ¶ added in v1.282.0
func (m *MarshallerMap) Get(kind string) Marshaller
Get from kind.
func (*MarshallerMap) Register ¶ added in v1.282.0
func (m *MarshallerMap) Register(kind string, mar Marshaller)
Register kind and marshaller.
Click to show internal directories.
Click to hide internal directories.