Documentation ¶
Index ¶
- Constants
- Variables
- type ConfigMap
- type EndpointHandler
- type HttpHandler
- type HttpTubeFactory
- func (f *HttpTubeFactory) GetHandleFunc(getEndpoint func(r *http.Request) (string, error), logger *common.Logger) func(http.ResponseWriter, *http.Request)
- func (f *HttpTubeFactory) Handle(ctx context.Context, endpoint string, record Record) error
- func (f *HttpTubeFactory) NewSinkTube(_ context.Context, _ ConfigMap) (chan<- Record, error)
- func (f *HttpTubeFactory) NewSourceTube(ctx context.Context, config ConfigMap) (<-chan Record, error)
- type MemoryQueueFactory
- type PulsarEventQueueFactory
- type PulsarTubeFactoryConfig
- type Record
- type RecordImpl
- type SinkQueueConfig
- type SinkTubeFactory
- type SourceQueueConfig
- type SourceTubeFactory
- type TubeFactory
Constants ¶
View Source
const ( EndpointKey = "endpoint" IncludeMetadata = "includeMetadata" )
View Source
const (
PulsarURLKey = "pulsar_url"
)
Variables ¶
View Source
var ( ErrTubeNotImplemented = errors.New("tube not implemented") ErrSinkTubeNotImplemented = errors.Wrap(ErrTubeNotImplemented, "sink tube not implemented") ErrSourceTubeNotImplemented = errors.Wrap(ErrTubeNotImplemented, "source tube not implemented") )
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶
type ConfigMap map[string]interface{}
func MergeConfig ¶
MergeConfig merges multiple ConfigMap into one
func ToConfigMap ¶ added in v0.5.0
func (ConfigMap) ToConfigStruct ¶ added in v0.4.0
type EndpointHandler ¶
type HttpHandler ¶ added in v0.5.0
type HttpTubeFactory ¶
type HttpTubeFactory struct { TubeFactory // contains filtered or unexported fields }
func NewHttpTubeFactory ¶
func NewHttpTubeFactory(ctx context.Context) *HttpTubeFactory
func NewHttpTubeFactoryWithIntercept ¶ added in v0.5.0
func NewHttpTubeFactoryWithIntercept(ctx context.Context, handler HttpHandler) *HttpTubeFactory
func (*HttpTubeFactory) GetHandleFunc ¶
func (*HttpTubeFactory) NewSinkTube ¶
func (*HttpTubeFactory) NewSourceTube ¶
type MemoryQueueFactory ¶
type MemoryQueueFactory struct {
// contains filtered or unexported fields
}
func (*MemoryQueueFactory) NewSinkTube ¶
func (*MemoryQueueFactory) NewSourceTube ¶
type PulsarEventQueueFactory ¶
type PulsarEventQueueFactory struct {
// contains filtered or unexported fields
}
func (*PulsarEventQueueFactory) NewSinkTube ¶
func (*PulsarEventQueueFactory) NewSourceTube ¶
type PulsarTubeFactoryConfig ¶
type PulsarTubeFactoryConfig struct {
PulsarURL string
}
func NewPulsarTubeFactoryConfig ¶
func NewPulsarTubeFactoryConfig(configMap ConfigMap) (*PulsarTubeFactoryConfig, error)
func (*PulsarTubeFactoryConfig) ToConfigMap ¶
func (c *PulsarTubeFactoryConfig) ToConfigMap() ConfigMap
type Record ¶
func DefaultHttpHandler ¶ added in v0.5.0
type RecordImpl ¶
type RecordImpl struct {
// contains filtered or unexported fields
}
func NewRecordImpl ¶
func NewRecordImpl(payload []byte, ackFunc func()) *RecordImpl
func NewSchemaRecordImpl ¶ added in v0.5.0
func NewSchemaRecordImpl(payload []byte, schema string, ackFunc func()) *RecordImpl
func (*RecordImpl) Commit ¶
func (e *RecordImpl) Commit()
func (*RecordImpl) GetPayload ¶
func (e *RecordImpl) GetPayload() []byte
func (*RecordImpl) GetSchema ¶ added in v0.5.0
func (e *RecordImpl) GetSchema() string
type SinkQueueConfig ¶
type SinkQueueConfig struct {
Topic string `json:"output" validate:"required"`
}
func (*SinkQueueConfig) ToConfigMap ¶
func (c *SinkQueueConfig) ToConfigMap() ConfigMap
type SinkTubeFactory ¶
type SinkTubeFactory interface { // NewSinkTube returns a new channel that can be used to sink events // The event.Commit() would be invoked after the event is sunk successfully // The caller should close the channel when it is done NewSinkTube(ctx context.Context, config ConfigMap) (chan<- Record, error) }
type SourceQueueConfig ¶
type SourceQueueConfig struct { Topics []string `json:"inputs" validate:"required"` SubName string `json:"subscription-name" validate:"required"` }
func (*SourceQueueConfig) ToConfigMap ¶
func (c *SourceQueueConfig) ToConfigMap() ConfigMap
type SourceTubeFactory ¶
type TubeFactory ¶
type TubeFactory interface { SourceTubeFactory SinkTubeFactory }
func NewMemoryQueueFactory ¶
func NewMemoryQueueFactory(ctx context.Context) TubeFactory
func NewPulsarEventQueueFactory ¶
func NewPulsarEventQueueFactory(ctx context.Context, configMap ConfigMap) (TubeFactory, error)
Click to show internal directories.
Click to hide internal directories.