Documentation ¶
Index ¶
- type Encoder
- func (e *Encoder) Encode() (io.ReadSeeker, error)
- func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)
- func (e *Encoder) SetList(t protocol.Target, k string, fn func(le protocol.ListEncoder), ...)
- func (e *Encoder) SetMap(t protocol.Target, k string, fn func(me protocol.MapEncoder), ...)
- func (e *Encoder) SetStream(t protocol.Target, k string, v protocol.StreamMarshaler, ...)
- func (e *Encoder) SetValue(t protocol.Target, k string, v protocol.ValueMarshaler, meta protocol.Metadata)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder provides encoding of the AWS JSON protocol. This encoder will will write all content to JSON. Only supports body and payload targets.
func NewEncoder ¶
func NewEncoder() *Encoder
NewEncoder creates a new encoder for encoding AWS JSON protocol. Only encodes fields into the JSON body, and error is returned if target is anything other than Body or Payload.
func (*Encoder) Encode ¶
func (e *Encoder) Encode() (io.ReadSeeker, error)
Encode returns the encoded XMl reader. An error will be returned if one was encountered while building the JSON body.
func (*Encoder) SetFields ¶
func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)
SetFields sets the nested fields to the JSON body.
func (*Encoder) SetList ¶
func (e *Encoder) SetList(t protocol.Target, k string, fn func(le protocol.ListEncoder), meta protocol.Metadata)
SetList creates an JSON list and calls the passed in fn callback with a list encoder.
func (*Encoder) SetMap ¶
func (e *Encoder) SetMap(t protocol.Target, k string, fn func(me protocol.MapEncoder), meta protocol.Metadata)
SetMap creates an JSON map and calls the passed in fn callback with a map encoder.