Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DROP = fmt.Sprintf("%U__DROP__", '\\') // U+005C__DROP__
)
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
type Messages ¶
type Messages []Message
func MessagesBuilder ¶
func MessagesBuilder() Messages
MessagesBuilder returns an empty instance of Messages
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.