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"`
Address string `json:"address" yaml:"address"`
Method string `json:"method" yaml:"method"` // full method: /package.Service/Method
TLS bool `json:"tls" yaml:"tls"`
ServerName string `json:"server_name" yaml:"server_name"`
Headers map[string]string `json:"headers" yaml:"headers"`
Request map[string]interface{} `json:"request" yaml:"request"`
SchemaName string `json:"schema_name" yaml:"schema_name"`
SchemaVersion string `json:"schema_version" yaml:"schema_version"`
FactTypeField string `json:"fact_type_field" yaml:"fact_type_field"`
Timeout time.Duration `json:"timeout" yaml:"timeout"`
BufferSize int `json:"buffer_size" yaml:"buffer_size"`
}
Config holds gRPC adapter configuration.
type Factory ¶
type Factory struct{}
Factory creates gRPC 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 gRPC streaming as a fact source.
func NewSource ¶
func NewSource(config *Config, mappings []adapters.FactMapping) (*Source, error)
NewSource creates a new gRPC 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.