Documentation
¶
Overview ¶
Package mapstreamer implements the server code for Map Stream Operation.
Examples: https://github.com/numaproj/numaflow-go/tree/main/examples/mapstreamer
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DROP = fmt.Sprintf("%U__DROP__", '\\') // U+005C__DROP__ NACK = fmt.Sprintf("%U__NACK__", '\\') // U+005C__NACK__ )
Functions ¶
Types ¶
type Datum ¶
type Datum interface {
// Value returns the payload of the message.
Value() []byte
// EventTime returns the event time of the message.
EventTime() time.Time
// Watermark returns the watermark of the message.
Watermark() time.Time
// Headers returns the headers of the message.
Headers() map[string]string
}
Datum contains methods to get the payload information.
type MapStreamer ¶
type MapStreamer interface {
// MapStream is the function to process each coming message and streams
// the result back using a channel.
MapStream(ctx context.Context, keys []string, datum Datum, messageCh chan<- Message)
}
MapStreamer is the interface of map stream function implementation.
type MapStreamerFunc ¶
type MapStreamerFunc func(ctx context.Context, keys []string, datum Datum, messageCh chan<- Message)
MapStreamerFunc is a utility type used to convert a function to a MapStreamer.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is used to wrap the data return by MapStream functions
func MessageToNack ¶ added in v0.12.0
func MessageToNack(opts *NackOptions) Message
MessageToNack creates a Message that negatively acknowledges the input message, requesting redelivery. opts may be nil; when set it carries redelivery options.
func (Message) NackOptions ¶ added in v0.12.0
func (m Message) NackOptions() *NackOptions
NackOptions returns the message's nack options (nil if not a nack message).
type Messages ¶
type Messages []Message
func MessagesBuilder ¶
func MessagesBuilder() Messages
MessagesBuilder returns an empty instance of Messages
type NackOptions ¶ added in v0.12.0
type NackOptions = nackoptions.NackOptions
NackOptions carries per-message redelivery options for a nacked message. See MessageToNack.
type Option ¶
type Option func(*options)
Option is the interface to apply options.
func WithMaxMessageSize ¶
WithMaxMessageSize sets the server max receive message size and the server max send message size to the given size.
func WithServerInfoFilePath ¶
WithServerInfoFilePath sets the server info file path to the given path.
func WithSockAddr ¶
WithSockAddr start the server with the given sock addr. This is mainly used for testing purposes.
type Service ¶
type Service struct {
mappb.UnimplementedMapServer
MapperStream MapStreamer
// contains filtered or unexported fields
}
Service implements the proto gen server interface and contains the map streaming function.