Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DROP = fmt.Sprintf("%U__DROP__", '\\') // U+005C__DROP__
)
Functions ¶
func NewBatchResponse ¶
func NewBatchResponse(id string) batchResponse
NewBatchResponse is a utility function used to create a new batchResponse object Specifying an id is a mandatory requirement, as it is required to reference the responses back to a request.
Types ¶
type BatchMapper ¶
type BatchMapper interface {
// BatchMap is the function which processes a list of input messages
BatchMap(ctx context.Context, datumStreamCh <-chan Datum) BatchResponses
}
BatchMapper is the interface for a Batch Map mode where the user is given a list of messages, and they return the consolidated response for all of them together.
type BatchMapperFunc ¶
type BatchMapperFunc func(ctx context.Context, datumStreamCh <-chan Datum) BatchResponses
BatchMapperFunc is a utility type used to convert a batch map function to a BatchMapper.
func (BatchMapperFunc) BatchMap ¶
func (mf BatchMapperFunc) BatchMap(ctx context.Context, datumStreamCh <-chan Datum) BatchResponses
BatchMap implements the functionality of BatchMap function.
type BatchResponses ¶
type BatchResponses []batchResponse
BatchResponses is a list of batchResponse which signify the consolidated results for a batch of input messages.
func BatchResponsesBuilder ¶
func BatchResponsesBuilder() BatchResponses
func (BatchResponses) Append ¶
func (m BatchResponses) Append(msg batchResponse) BatchResponses
Append appends a batchResponse
func (BatchResponses) Items ¶
func (m BatchResponses) Items() []batchResponse
Items returns the batchResponse list
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
// Id returns the unique ID set for the given message
Id() string
// Keys returns the keys associated with a given datum
Keys() []string
}
Datum contains methods to get the payload information.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is used to wrap the data return by Batch Map functions
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
BatchMapper BatchMapper
// contains filtered or unexported fields
}
Service implements the proto gen server interface and contains the map operation handler.