Documentation
¶
Index ¶
- Constants
- func EncodeHeaders(w io.Writer, headers Headers) error
- type BoolValue
- type BytesValue
- type ChecksumError
- type Decoder
- type DecoderOptions
- type Encoder
- type EncoderOptions
- type Header
- type Headers
- type Int8Value
- type Int16Value
- type Int32Value
- type Int64Value
- type LengthError
- type Message
- type MessageSigner
- type ShapeDeserializer
- func (d *ShapeDeserializer) ReadBigFloat(_ *smithy.Schema, _ *big.Float) error
- func (d *ShapeDeserializer) ReadBigInt(_ *smithy.Schema, _ *big.Int) error
- func (d *ShapeDeserializer) ReadBlob(s *smithy.Schema, v *[]byte) error
- func (d *ShapeDeserializer) ReadBool(s *smithy.Schema, v *bool) error
- func (d *ShapeDeserializer) ReadDocument(s *smithy.Schema, v *document.Value) error
- func (d *ShapeDeserializer) ReadFloat32(s *smithy.Schema, v *float32) error
- func (d *ShapeDeserializer) ReadFloat64(s *smithy.Schema, v *float64) error
- func (d *ShapeDeserializer) ReadInt8(s *smithy.Schema, v *int8) error
- func (d *ShapeDeserializer) ReadInt16(s *smithy.Schema, v *int16) error
- func (d *ShapeDeserializer) ReadInt32(s *smithy.Schema, v *int32) error
- func (d *ShapeDeserializer) ReadInt64(s *smithy.Schema, v *int64) error
- func (d *ShapeDeserializer) ReadList(s *smithy.Schema) error
- func (d *ShapeDeserializer) ReadListItem(s *smithy.Schema) (bool, error)
- func (d *ShapeDeserializer) ReadMap(s *smithy.Schema) error
- func (d *ShapeDeserializer) ReadMapKey(s *smithy.Schema) (string, bool, error)
- func (d *ShapeDeserializer) ReadNil(s *smithy.Schema) (bool, error)
- func (d *ShapeDeserializer) ReadString(s *smithy.Schema, v *string) error
- func (d *ShapeDeserializer) ReadStruct(s *smithy.Schema) error
- func (d *ShapeDeserializer) ReadStructMember() (*smithy.Schema, error)
- func (d *ShapeDeserializer) ReadTime(s *smithy.Schema, v *time.Time) error
- func (d *ShapeDeserializer) ReadUnion(s *smithy.Schema) (*smithy.Schema, error)
- type ShapeSerializer
- func (s *ShapeSerializer) Bytes() []byte
- func (s *ShapeSerializer) CloseList()
- func (s *ShapeSerializer) CloseMap()
- func (s *ShapeSerializer) CloseStruct()
- func (s *ShapeSerializer) CloseUnion()
- func (s *ShapeSerializer) ContentType() string
- func (s *ShapeSerializer) WriteBigFloat(schema *smithy.Schema, v *big.Float)
- func (s *ShapeSerializer) WriteBigInt(schema *smithy.Schema, v *big.Int)
- func (s *ShapeSerializer) WriteBlob(schema *smithy.Schema, v []byte)
- func (s *ShapeSerializer) WriteBool(schema *smithy.Schema, v bool)
- func (s *ShapeSerializer) WriteDocument(schema *smithy.Schema, v document.Value)
- func (s *ShapeSerializer) WriteFloat32(schema *smithy.Schema, v float32)
- func (s *ShapeSerializer) WriteFloat64(schema *smithy.Schema, v float64)
- func (s *ShapeSerializer) WriteInt8(schema *smithy.Schema, v int8)
- func (s *ShapeSerializer) WriteInt16(schema *smithy.Schema, v int16)
- func (s *ShapeSerializer) WriteInt32(schema *smithy.Schema, v int32)
- func (s *ShapeSerializer) WriteInt64(schema *smithy.Schema, v int64)
- func (s *ShapeSerializer) WriteKey(schema *smithy.Schema, key string)
- func (s *ShapeSerializer) WriteList(schema *smithy.Schema)
- func (s *ShapeSerializer) WriteMap(schema *smithy.Schema)
- func (s *ShapeSerializer) WriteNil(schema *smithy.Schema)
- func (s *ShapeSerializer) WriteString(schema *smithy.Schema, v string)
- func (s *ShapeSerializer) WriteStruct(schema *smithy.Schema)
- func (s *ShapeSerializer) WriteTime(schema *smithy.Schema, v time.Time)
- func (s *ShapeSerializer) WriteUnion(schema, variant *smithy.Schema)
- type SigningWriter
- type StringValue
- type TimestampValue
- type UUIDValue
- type UnknownMessageError
- type UnknownUnionMember
- type Value
Constants ¶
const ( ChunkSignatureHeader = `:chunk-signature` // chunk signature for message DateHeader = `:date` // Date header for signature ContentTypeHeader = ":content-type" // message payload content-type // Message header and values MessageTypeHeader = `:message-type` // Identifies type of message. EventMessageType = `event` ErrorMessageType = `error` ExceptionMessageType = `exception` // Message Events EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". // Message Error ErrorCodeHeader = `:error-code` ErrorMessageHeader = `:error-message` // Message Exception ExceptionTypeHeader = `:exception-type` )
EventStream headers with specific meaning to async API functionality.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolValue ¶
type BoolValue bool
An BoolValue provides eventstream encoding, and representation of a Go bool value.
type BytesValue ¶
type BytesValue []byte
An BytesValue provides eventstream encoding, and representation of a Go byte slice.
func (BytesValue) String ¶
func (v BytesValue) String() string
type ChecksumError ¶
type ChecksumError struct{}
ChecksumError provides the error for message checksum invalidation errors.
func (ChecksumError) Error ¶
func (e ChecksumError) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder provides decoding of an Event Stream messages.
func NewDecoder ¶
func NewDecoder(optFns ...func(*DecoderOptions)) *Decoder
NewDecoder initializes and returns a Decoder for decoding event stream messages from the reader provided.
func (*Decoder) Decode ¶
Decode attempts to decode a single message from the event stream reader. Will return the event stream message, or error if decodeMessage fails to read the message from the stream.
payloadBuf is a byte slice that will be used in the returned Message.Payload. Callers must ensure that the Message.Payload from a previous decode has been consumed before passing in the same underlying payloadBuf byte slice.
type DecoderOptions ¶
DecoderOptions is the Decoder configuration options.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder provides EventStream message encoding.
func NewEncoder ¶
func NewEncoder(optFns ...func(*EncoderOptions)) *Encoder
NewEncoder initializes and returns an Encoder to encode Event Stream messages.
type EncoderOptions ¶
EncoderOptions is the configuration options for Encoder.
type Headers ¶
type Headers []Header
Headers are a collection of EventStream header values.
type Int8Value ¶
type Int8Value int8
An Int8Value provides eventstream encoding, and representation of a Go int8 value.
type Int16Value ¶
type Int16Value int16
An Int16Value provides eventstream encoding, and representation of a Go int16 value.
func (Int16Value) String ¶
func (v Int16Value) String() string
type Int32Value ¶
type Int32Value int32
An Int32Value provides eventstream encoding, and representation of a Go int32 value.
func (Int32Value) String ¶
func (v Int32Value) String() string
type Int64Value ¶
type Int64Value int64
An Int64Value provides eventstream encoding, and representation of a Go int64 value.
func (Int64Value) String ¶
func (v Int64Value) String() string
type LengthError ¶
LengthError provides the error for items being larger than a maximum length.
func (LengthError) Error ¶
func (e LengthError) Error() string
type MessageSigner ¶
type MessageSigner interface {
SignMessage(headers, payload []byte, signingTime time.Time) ([]byte, error)
}
MessageSigner signs event stream message header and payload byte pairs. Each invocation chains off the previous signature.
type ShapeDeserializer ¶
type ShapeDeserializer struct {
Message *Message
// contains filtered or unexported fields
}
ShapeDeserializer wraps a smithy.ShapeDeserializer to handle event stream message binding traits.
func NewShapeDeserializer ¶
func NewShapeDeserializer(msg *Message, inner smithy.ShapeDeserializer) *ShapeDeserializer
NewShapeDeserializer returns a deserializer for a Message.
func (*ShapeDeserializer) ReadBigFloat ¶
ReadBigFloat is unimplemented and will return an error.
func (*ShapeDeserializer) ReadBigInt ¶
ReadBigInt is unimplemented and will return an error.
func (*ShapeDeserializer) ReadBlob ¶
func (d *ShapeDeserializer) ReadBlob(s *smithy.Schema, v *[]byte) error
func (*ShapeDeserializer) ReadBool ¶
func (d *ShapeDeserializer) ReadBool(s *smithy.Schema, v *bool) error
func (*ShapeDeserializer) ReadDocument ¶
func (*ShapeDeserializer) ReadFloat32 ¶
func (d *ShapeDeserializer) ReadFloat32(s *smithy.Schema, v *float32) error
func (*ShapeDeserializer) ReadFloat64 ¶
func (d *ShapeDeserializer) ReadFloat64(s *smithy.Schema, v *float64) error
func (*ShapeDeserializer) ReadInt8 ¶
func (d *ShapeDeserializer) ReadInt8(s *smithy.Schema, v *int8) error
func (*ShapeDeserializer) ReadInt16 ¶
func (d *ShapeDeserializer) ReadInt16(s *smithy.Schema, v *int16) error
func (*ShapeDeserializer) ReadInt32 ¶
func (d *ShapeDeserializer) ReadInt32(s *smithy.Schema, v *int32) error
func (*ShapeDeserializer) ReadInt64 ¶
func (d *ShapeDeserializer) ReadInt64(s *smithy.Schema, v *int64) error
func (*ShapeDeserializer) ReadListItem ¶
func (d *ShapeDeserializer) ReadListItem(s *smithy.Schema) (bool, error)
func (*ShapeDeserializer) ReadMapKey ¶
func (*ShapeDeserializer) ReadNil ¶
func (d *ShapeDeserializer) ReadNil(s *smithy.Schema) (bool, error)
func (*ShapeDeserializer) ReadString ¶
func (d *ShapeDeserializer) ReadString(s *smithy.Schema, v *string) error
func (*ShapeDeserializer) ReadStruct ¶
func (d *ShapeDeserializer) ReadStruct(s *smithy.Schema) error
func (*ShapeDeserializer) ReadStructMember ¶
func (d *ShapeDeserializer) ReadStructMember() (*smithy.Schema, error)
type ShapeSerializer ¶
type ShapeSerializer struct {
Message *Message
// contains filtered or unexported fields
}
ShapeSerializer wraps a smithy.ShapeSerializer, much like the internal httpbinding serializer, to handle event stream message binding traits.
func NewShapeSerializer ¶
func NewShapeSerializer(msg *Message, inner smithy.ShapeSerializer) *ShapeSerializer
NewShapeSerializer returns a serializer for a single Message.
func (*ShapeSerializer) Bytes ¶
func (s *ShapeSerializer) Bytes() []byte
Bytes returns the serialized body bytes.
func (*ShapeSerializer) CloseList ¶
func (s *ShapeSerializer) CloseList()
CloseList implements smithy.ShapeSerializer.
func (*ShapeSerializer) CloseMap ¶
func (s *ShapeSerializer) CloseMap()
CloseMap implements smithy.ShapeSerializer.
func (*ShapeSerializer) CloseStruct ¶
func (s *ShapeSerializer) CloseStruct()
CloseStruct implements smithy.ShapeSerializer.
func (*ShapeSerializer) CloseUnion ¶
func (s *ShapeSerializer) CloseUnion()
CloseUnion implements smithy.ShapeSerializer.
func (*ShapeSerializer) ContentType ¶
func (s *ShapeSerializer) ContentType() string
ContentType returns the resolved content type for the event message payload after serialization, which may be affected by bindings.
func (*ShapeSerializer) WriteBigFloat ¶
func (s *ShapeSerializer) WriteBigFloat(schema *smithy.Schema, v *big.Float)
WriteBigFloat implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteBigInt ¶
func (s *ShapeSerializer) WriteBigInt(schema *smithy.Schema, v *big.Int)
WriteBigInt implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteBlob ¶
func (s *ShapeSerializer) WriteBlob(schema *smithy.Schema, v []byte)
WriteBlob implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteBool ¶
func (s *ShapeSerializer) WriteBool(schema *smithy.Schema, v bool)
WriteBool implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteDocument ¶
func (s *ShapeSerializer) WriteDocument(schema *smithy.Schema, v document.Value)
WriteDocument implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteFloat32 ¶
func (s *ShapeSerializer) WriteFloat32(schema *smithy.Schema, v float32)
WriteFloat32 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteFloat64 ¶
func (s *ShapeSerializer) WriteFloat64(schema *smithy.Schema, v float64)
WriteFloat64 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteInt8 ¶
func (s *ShapeSerializer) WriteInt8(schema *smithy.Schema, v int8)
WriteInt8 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteInt16 ¶
func (s *ShapeSerializer) WriteInt16(schema *smithy.Schema, v int16)
WriteInt16 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteInt32 ¶
func (s *ShapeSerializer) WriteInt32(schema *smithy.Schema, v int32)
WriteInt32 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteInt64 ¶
func (s *ShapeSerializer) WriteInt64(schema *smithy.Schema, v int64)
WriteInt64 implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteKey ¶
func (s *ShapeSerializer) WriteKey(schema *smithy.Schema, key string)
WriteKey implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteList ¶
func (s *ShapeSerializer) WriteList(schema *smithy.Schema)
WriteList implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteMap ¶
func (s *ShapeSerializer) WriteMap(schema *smithy.Schema)
WriteMap implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteNil ¶
func (s *ShapeSerializer) WriteNil(schema *smithy.Schema)
WriteNil implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteString ¶
func (s *ShapeSerializer) WriteString(schema *smithy.Schema, v string)
WriteString implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteStruct ¶
func (s *ShapeSerializer) WriteStruct(schema *smithy.Schema)
WriteStruct implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteTime ¶
func (s *ShapeSerializer) WriteTime(schema *smithy.Schema, v time.Time)
WriteTime implements smithy.ShapeSerializer.
func (*ShapeSerializer) WriteUnion ¶
func (s *ShapeSerializer) WriteUnion(schema, variant *smithy.Schema)
WriteUnion implements smithy.ShapeSerializer.
type SigningWriter ¶
type SigningWriter struct {
// contains filtered or unexported fields
}
SigningWriter wraps an io.WriteCloser and signs each event stream message frame written to it. Each Write call MUST contain exactly one complete encoded event stream message frame.
The signing writer wraps each incoming frame in an outer event stream message with :date and :chunk-signature headers, then encodes the outer message to the underlying writer.
Close sends a signed empty message to signal end-of-stream, then closes the underlying writer.
func NewSigningWriter ¶
func NewSigningWriter(w io.WriteCloser, signer MessageSigner) *SigningWriter
NewSigningWriter returns a SigningWriter that signs frames and writes them to w.
func (*SigningWriter) Close ¶
func (s *SigningWriter) Close() error
Close sends a signed empty message to signal end-of-stream, then closes the underlying writer.
type StringValue ¶
type StringValue string
An StringValue provides eventstream encoding, and representation of a Go string.
func (StringValue) String ¶
func (v StringValue) String() string
type TimestampValue ¶
An TimestampValue provides eventstream encoding, and representation of a Go timestamp.
func (TimestampValue) MarshalJSON ¶
func (v TimestampValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (TimestampValue) String ¶
func (v TimestampValue) String() string
type UUIDValue ¶
type UUIDValue [16]byte
An UUIDValue provides eventstream encoding, and representation of a UUID value.
type UnknownMessageError ¶
UnknownMessageError provides an error when a message is received from the stream, but the reader is unable to determine what kind of message it is.
func (*UnknownMessageError) Error ¶
func (e *UnknownMessageError) Error() string
type UnknownUnionMember ¶
UnknownUnionMember is returned when a union member is returned over the wire, but has an unknown tag.
func (*UnknownUnionMember) Deserialize ¶
func (*UnknownUnionMember) Deserialize(smithy.ShapeDeserializer) error
Deserialize is a no-op. The raw bytes are already captured in Value.