Documentation
¶
Index ¶
- type Config
- type Factory
- type Source
- func (s *Source) GetMetadata() adapters.SourceMetadata
- func (s *Source) GetSourceSchema() *adapters.Schema
- func (s *Source) HealthCheck() error
- func (s *Source) Start(ctx context.Context) error
- func (s *Source) Stop(ctx context.Context) error
- func (s *Source) Subscribe(ctx context.Context, factTypes []string) (<-chan *adapters.TypedFact, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
SourceID string `json:"source_id" yaml:"source_id"`
URL string `json:"url" yaml:"url"`
Queue string `json:"queue" yaml:"queue"`
Exchange string `json:"exchange" yaml:"exchange"`
RoutingKey string `json:"routing_key" yaml:"routing_key"`
ConsumerTag string `json:"consumer_tag" yaml:"consumer_tag"`
AutoAck bool `json:"auto_ack" yaml:"auto_ack"`
Prefetch int `json:"prefetch" yaml:"prefetch"`
Format string `json:"format" yaml:"format"` // json or raw
SchemaName string `json:"schema_name" yaml:"schema_name"`
SchemaVersion string `json:"schema_version" yaml:"schema_version"`
SchemaHeader string `json:"schema_header" yaml:"schema_header"`
QueueDeclare bool `json:"queue_declare" yaml:"queue_declare"`
QueueDurable bool `json:"queue_durable" yaml:"queue_durable"`
QueueExclusive bool `json:"queue_exclusive" yaml:"queue_exclusive"`
QueueAutoDel bool `json:"queue_auto_delete" yaml:"queue_auto_delete"`
ExchangeType string `json:"exchange_type" yaml:"exchange_type"`
ExchangeDeclare bool `json:"exchange_declare" yaml:"exchange_declare"`
Headers map[string]string `json:"headers" yaml:"headers"`
BufferSize int `json:"buffer_size" yaml:"buffer_size"`
}
Config holds AMQP adapter configuration.
type Factory ¶
type Factory struct{}
Factory creates AMQP sources from generic config.
func (*Factory) Create ¶
func (f *Factory) Create(config adapters.SourceConfig) (adapters.FactSource, error)
func (*Factory) GetConfigSchema ¶
func (f *Factory) GetConfigSchema() adapters.ConfigSchema
func (*Factory) ValidateConfig ¶
func (f *Factory) ValidateConfig(config adapters.SourceConfig) error
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements AMQP consumption as a fact source.
func NewSource ¶
func NewSource(config *Config, mappings []adapters.FactMapping) (*Source, error)
NewSource creates a new AMQP source.
func (*Source) GetMetadata ¶
func (s *Source) GetMetadata() adapters.SourceMetadata
GetMetadata returns source metadata.
func (*Source) GetSourceSchema ¶
GetSourceSchema returns schema metadata.
func (*Source) HealthCheck ¶
HealthCheck checks connection status.
Click to show internal directories.
Click to hide internal directories.