protocol.go (1190B)
1 package http 2 3 import ( 4 "context" 5 "io" 6 7 "github.com/aws/smithy-go" 8 ) 9 10 // ClientProtocol defines the interface through which client-side operation 11 // request/responses are (de)serialized across the wire. 12 // 13 // While a caller CAN define their own protocol, it is almost never necessary 14 // to do so. In practice, a generated client will utilize one of the predefined 15 // protocols implemented as part of the Smithy client runtime. 16 type ClientProtocol interface { 17 ID() smithy.ShapeID 18 SerializeRequest(context.Context, *smithy.OperationSchema, smithy.Serializable, *Request) error 19 DeserializeResponse(ctx context.Context, schema *smithy.OperationSchema, types *smithy.TypeRegistry, resp *Response, out smithy.Deserializable) error 20 21 // event stream APIs 22 HasInitialEventMessage() bool 23 SerializeEventMessage(schema, variant *smithy.Schema, v smithy.Serializable, w io.Writer) error 24 DeserializeEventMessage(schema *smithy.Schema, types *smithy.TypeRegistry, r io.Reader) (smithy.Deserializable, error) 25 SerializeInitialRequest(schema *smithy.Schema, v smithy.Serializable, w io.Writer) error 26 DeserializeInitialResponse(schema *smithy.Schema, r io.Reader, out smithy.Deserializable) error 27 }