Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Collector
 - type CollectorArgs
 - type Output
 - type RawState
 - type Record
 - type SingerOutput
 - type SingerTap
 - func (t *SingerTap) GetName() string
 - func (t *SingerTap) Run() (<-chan *utils.ProcessResponse[Output[json.RawMessage]], errors.Error)
 - func (t *SingerTap) SetConfig(cfg any) errors.Error
 - func (t *SingerTap) SetProperties(streamName string, propsModifier func(props *SingerTapStream) bool) (uint64, errors.Error)
 - func (t *SingerTap) SetState(state any) errors.Error
 
- type SingerTapConfig
 - type SingerTapMetadata
 - type SingerTapProperties
 - type SingerTapSchema
 - type SingerTapStream
 - type State
 - type Tap
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector[Stream any] struct { // contains filtered or unexported fields }
Collector the collector that communicates with singer taps
func NewTapCollector ¶
func NewTapCollector[Stream any](args *CollectorArgs[Stream]) (*Collector[Stream], errors.Error)
NewTapCollector constructor for Collector
type CollectorArgs ¶
type CollectorArgs[Stream any] struct { helper.RawDataSubTaskArgs // The function that creates and returns a tap client TapClient Tap[Stream] // Optional - This function is called for the selected streams at runtime. Use this if any runtime modification is needed. TapStreamModifier func(stream *Stream) bool // The config the tap needs at runtime in order to execute TapConfig any // The specific tap stream to invoke at runtime StreamName string ConnectionId uint64 Table string Incremental bool }
CollectorArgs args to initialize a Collector
type Output ¶
type Output[R any] interface { // AsTapState tries to convert the map object to a State. Returns false if it can't be done. AsTapState() (*State, bool) // AsTapRecord tries to convert the map object to a Record. Returns false if it can't be done. AsTapRecord() (*Record[R], bool) }
Output raw data from a tap. One of these fields can ever be non-nil
func NewSingerTapOutput ¶
func NewSingerTapOutput(src json.RawMessage) (Output[json.RawMessage], errors.Error)
NewSingerTapOutput construct for Output. The src is the raw data coming from the tap
type Record ¶
type Record[R any] struct { Type string `json:"type"` Stream string `json:"stream"` TimeExtracted time.Time `json:"time_extracted"` Record R `json:"record"` }
Record the fields embedded in a singer-tap record. The specifics of the record are tap-implementation specific.
type SingerOutput ¶
type SingerOutput struct {
	// contains filtered or unexported fields
}
    SingerOutput raw data from a tap. One of these fields can ever be non-nil
func (*SingerOutput) AsTapRecord ¶
func (r *SingerOutput) AsTapRecord() (*Record[json.RawMessage], bool)
AsTapRecord tries to convert the map object to a Record. Returns false if it can't be done.
func (*SingerOutput) AsTapState ¶
func (r *SingerOutput) AsTapState() (*State, bool)
AsTapState tries to convert the map object to a State. Returns false if it can't be done.
type SingerTap ¶
type SingerTap struct {
	*SingerTapConfig
	// contains filtered or unexported fields
}
    SingerTap the Singer implementation of Tap
func NewSingerTap ¶
func NewSingerTap(cfg *SingerTapConfig) (*SingerTap, errors.Error)
NewSingerTap the constructor for SingerTap
func (*SingerTap) Run ¶
func (t *SingerTap) Run() (<-chan *utils.ProcessResponse[Output[json.RawMessage]], errors.Error)
Run implements Tap.Run
func (*SingerTap) SetProperties ¶
func (t *SingerTap) SetProperties(streamName string, propsModifier func(props *SingerTapStream) bool) (uint64, errors.Error)
SetProperties implements Tap.SetProperties
type SingerTapConfig ¶
SingerTapConfig the set of variables needed to initialize a SingerTap
type SingerTapMetadata ¶
SingerTapMetadata the structure of this is determined by the catalog/properties JSON of a singer tap
type SingerTapProperties ¶
type SingerTapProperties struct {
	Streams []*SingerTapStream `json:"streams"`
}
    SingerTapProperties wraps SingerTapStreams
type SingerTapSchema ¶
SingerTapSchema the structure of this is determined by the catalog/properties JSON of a singer tap
type SingerTapStream ¶
type SingerTapStream struct {
	Stream        string              `json:"stream"`
	TapStreamId   string              `json:"tap_stream_id"`
	Schema        SingerTapSchema     `json:"schema"`
	Metadata      []SingerTapMetadata `json:"metadata"`
	KeyProperties any                 `json:"key_properties"`
}
    SingerTapStream the deserialized version of each stream entry in the catalog/properties JSON of a singer tap
type State ¶
State the fields embedded in a singer-tap state. The specifics of the value are tap-implementation specific.
type Tap ¶
type Tap[Stream any] interface { // Run runs the tap and returns a stream of results. Expected to be called after all the other Setters. Run() (<-chan *utils.ProcessResponse[Output[json.RawMessage]], errors.Error) // GetName the name of this tap GetName() string // SetProperties Sets the properties of the tap and allows you to modify the properties at runtime. // Returns a unique hash representing the properties object. SetProperties(streamName string, propsModifier func(props *Stream) bool) (uint64, errors.Error) // SetState sets state on this tap SetState(state any) errors.Error // SetConfig sets the config of this tap SetConfig(config any) errors.Error }
Tap the abstract interface for Taps. Consumer code should not use concrete implementations directly.