Documentation ¶
Index ¶
- Constants
- Variables
- func RouteProduceBodyMapConvert[Req any, Key any, Value any](source stateless.OneToOneFunction[message.Bytes, Req, Key, Value], ...) ...
- func RouteProduceTopicBodyMapConvert[Req any, Key any, Value any](source stateless.OneToOneFunction[message.Bytes, Req, Key, Value], ...) ...
- func WithFlow(input []FlowEntryTopic, output []FlowEntryTopic, stateTable string) runtime.Configuration[*RouteFlow]
- func WithFlowMaterialiseOneToOne[IK any, IV any](input topic.Topic[IK, IV]) runtime.Configuration[*RouteFlow]
- func WithFlowStatefulOneToOne[IK any, IV any, OK any, OV any](input topic.Topic[IK, IV], output topic.Topic[OK, OV], stateTable string) runtime.Configuration[*RouteFlow]
- func WithFlowStatefulOneToTwo[IK any, IV any, OK1 any, OV1 any, OK2 any, OV2 any](input topic.Topic[IK, IV], output1 topic.Topic[OK1, OV1], ...) runtime.Configuration[*RouteFlow]
- func WithFlowStatelessOneToOne[IK any, IV any, OK any, OV any](input topic.Topic[IK, IV], output topic.Topic[OK, OV]) runtime.Configuration[*RouteFlow]
- func WithFlowStatelessOneToTwo[IK any, IV any, OK1 any, OV1 any, OK2 any, OV2 any](input topic.Topic[IK, IV], output1 topic.Topic[OK1, OV1], ...) runtime.Configuration[*RouteFlow]
- func WithRouteBodyMap(...) runtime.Configuration[*RouteProducer]
- func WithRouteProducerRuntime(producer message.Producer) runtime.Configuration[*RouteProducer]
- func WriteError(w http.ResponseWriter, httpStatus int, err error) error
- func WriteJson[R any](w http.ResponseWriter, httpStatus int, r R, f format.Format[R]) error
- type BasicResponse
- type FlowEntries
- type FlowEntry
- type FlowEntryTopic
- type RouteFlow
- type RouteProducer
Constants ¶
View Source
const ( RouteHeaderPrefix = "HTTP_HEADER_" RouteParamPrefix = "HTTP_PARAM_" RouteRequestKeyHeader = "HTTP_HEADER_X_REQUEST_KEY" )
Variables ¶
View Source
var ErrorRouteGettingRequestBody = errors.New("route getting request body")
View Source
var ErrorRouteMappingRequestBody = errors.New("route mapping request body")
View Source
var ErrorRouteParsingRequestBody = errors.New("route parsing request body")
View Source
var ErrorRouteProducingMessage = errors.New("route producing message")
View Source
var ErrorRouteReadingRequestBody = errors.New("route reading request body")
View Source
var ErrorWriteJsonFormat = errors.New("write json formatting")
Functions ¶
func RouteProduceBodyMapConvert ¶ added in v0.0.11
func RouteProduceBodyMapConvert[Req any, Key any, Value any]( source stateless.OneToOneFunction[message.Bytes, Req, Key, Value], requestFormat format.Format[Req], keyFormat format.Format[Key], valueFormat format.Format[Value], ) stateless.OneToOneFunction[message.Bytes, message.Bytes, message.Bytes, message.Bytes]
func RouteProduceTopicBodyMapConvert ¶ added in v0.0.16
func WithFlow ¶ added in v0.0.17
func WithFlow(input []FlowEntryTopic, output []FlowEntryTopic, stateTable string) runtime.Configuration[*RouteFlow]
configurations
func WithFlowMaterialiseOneToOne ¶ added in v0.0.17
func WithFlowStatefulOneToOne ¶ added in v0.0.17
func WithFlowStatefulOneToTwo ¶ added in v0.0.17
func WithFlowStatelessOneToOne ¶ added in v0.0.17
func WithFlowStatelessOneToTwo ¶ added in v0.0.17
func WithRouteBodyMap ¶ added in v0.0.4
func WithRouteBodyMap(bodyMap stateless.OneToOneFunction[message.Bytes, message.Bytes, message.Bytes, message.Bytes]) runtime.Configuration[*RouteProducer]
func WithRouteProducerRuntime ¶ added in v0.0.4
func WithRouteProducerRuntime(producer message.Producer) runtime.Configuration[*RouteProducer]
configurations
func WriteError ¶
func WriteError(w http.ResponseWriter, httpStatus int, err error) error
Types ¶
type BasicResponse ¶ added in v0.0.4
type BasicResponse struct {
Message string `json:"message"`
}
route
type FlowEntries ¶ added in v0.0.17
type FlowEntries struct {
Entries []FlowEntry `json:"entries"`
}
type FlowEntry ¶ added in v0.0.17
type FlowEntry struct { Input []FlowEntryTopic `json:"inputs"` Output []FlowEntryTopic `json:"outputs"` StateTable string `json:"state_table"` }
type FlowEntryTopic ¶ added in v0.0.17
type FlowEntryTopic struct { Topic string `json:"topic"` KeyType string `json:"key_type"` ValueType string `json:"value_type"` }
implementation
func FlowEntryFromTopic ¶ added in v0.0.17
func FlowEntryFromTopic[IK any, IV any](topic topic.Topic[IK, IV]) FlowEntryTopic
type RouteFlow ¶ added in v0.0.17
type RouteFlow struct {
// contains filtered or unexported fields
}
func NewRouteFlow ¶ added in v0.0.17
func NewRouteFlow(configurations ...runtime.Configuration[*RouteFlow]) *RouteFlow
constructor
type RouteProducer ¶ added in v0.0.4
type RouteProducer struct {
// contains filtered or unexported fields
}
implementation
func NewRouteProducer ¶ added in v0.0.4
func NewRouteProducer(configurations ...runtime.Configuration[*RouteProducer]) *RouteProducer
constructor
func (*RouteProducer) Handle ¶ added in v0.0.4
func (rp *RouteProducer) Handle(w http.ResponseWriter, req *http.Request)
func (*RouteProducer) Produce ¶ added in v0.0.4
func (rp *RouteProducer) Produce(w http.ResponseWriter, req *http.Request) error
Click to show internal directories.
Click to hide internal directories.