Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InputPayload ¶
type InputPayload struct {
Required bool `json:"required"`
ContentType *string `json:"contentType,omitempty"`
JsonSchema interface{} `json:"jsonSchema,omitempty"`
}
func InputPayloadFor ¶
func InputPayloadFor(codec PayloadCodec, i any) *InputPayload
type OutputPayload ¶
type OutputPayload struct {
ContentType *string `json:"contentType,omitempty"`
SetContentTypeIfEmpty bool `json:"setContentTypeIfEmpty"`
JsonSchema interface{} `json:"jsonSchema,omitempty"`
}
func OutputPayloadFor ¶
func OutputPayloadFor(codec PayloadCodec, o any) *OutputPayload
type PayloadCodec ¶
type PayloadCodec interface {
InputPayload() *InputPayload
OutputPayload() *OutputPayload
Codec
}
var ( // BinaryCodec marshals []byte and unmarshals into *[]byte // In handlers, it uses a content type of application/octet-stream BinaryCodec PayloadCodec = binaryCodec{} // VoidCodec marshals anything into []byte(nil) and skips unmarshaling // In handlers, it requires that there is no input content-type and does not set an output content-type VoidCodec PayloadCodec = voidCodec{} // ProtoCodec marshals proto.Message and unmarshals into proto.Message or pointers to types that implement proto.Message // In handlers, it uses a content-type of application/proto ProtoCodec PayloadCodec = protoCodec{} // JSONCodec marshals any json.Marshallable type and unmarshals into any json.Unmarshallable type // In handlers, it uses a content-type of application/json JSONCodec PayloadCodec = jsonCodec{} )
type RestateMarshaler ¶
type RestateMarshaler interface {
RestateMarshal(codec Codec) ([]byte, error)
OutputPayload(codec Codec) *OutputPayload
}
RestateMarshaler can be implemented by types that want to control their own marshaling
func RestateMarshalerFor ¶
func RestateMarshalerFor[O any]() (RestateMarshaler, bool)
type RestateUnmarshaler ¶
type RestateUnmarshaler interface {
RestateUnmarshal(codec Codec, data []byte) error
InputPayload(codec Codec) *InputPayload
}
type Void ¶
type Void struct{}
Void is a placeholder to signify 'no value' where a type is otherwise needed
func (Void) InputPayload ¶
func (v Void) InputPayload(codec Codec) *InputPayload
func (Void) OutputPayload ¶
func (v Void) OutputPayload(codec Codec) *OutputPayload
Click to show internal directories.
Click to hide internal directories.