Documentation
¶
Index ¶
- type Config
- type Factory
- type HTTPSource
- func (h *HTTPSource) GetMetadata() adapters.SourceMetadata
- func (h *HTTPSource) GetSourceSchema() *adapters.Schema
- func (h *HTTPSource) HealthCheck() error
- func (h *HTTPSource) Start(ctx context.Context) error
- func (h *HTTPSource) Stop(ctx context.Context) error
- func (h *HTTPSource) Subscribe(ctx context.Context, factTypes []string) (<-chan *adapters.TypedFact, error)
- type MessageTransformer
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"`
ListenPort int `json:"listen_port" yaml:"listen_port"`
Path string `json:"path" yaml:"path"`
AuthMethod string `json:"auth_method" yaml:"auth_method"`
AuthConfig map[string]string `json:"auth_config" yaml:"auth_config"`
ContentTypes []string `json:"content_types" yaml:"content_types"`
Transformations []adapters.Transformation `json:"transformations" yaml:"transformations"`
}
Config holds HTTP source configuration
type Factory ¶
type Factory struct{}
Factory for HTTP sources
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 HTTPSource ¶
type HTTPSource struct {
// contains filtered or unexported fields
}
HTTPSource implements the FactSource interface for HTTP webhooks
func NewHTTPSource ¶
func NewHTTPSource(config *Config) (*HTTPSource, error)
NewHTTPSource creates a new HTTP webhook fact source
func (*HTTPSource) GetMetadata ¶
func (h *HTTPSource) GetMetadata() adapters.SourceMetadata
GetMetadata implements FactSource.GetMetadata
func (*HTTPSource) GetSourceSchema ¶
func (h *HTTPSource) GetSourceSchema() *adapters.Schema
GetSourceSchema implements FactSource.GetSourceSchema
func (*HTTPSource) HealthCheck ¶
func (h *HTTPSource) HealthCheck() error
HealthCheck implements FactSource.HealthCheck
func (*HTTPSource) Start ¶
func (h *HTTPSource) Start(ctx context.Context) error
Start implements FactSource.Start
type MessageTransformer ¶
type MessageTransformer struct {
// contains filtered or unexported fields
}
MessageTransformer transforms HTTP requests to TypedFacts
func (*MessageTransformer) TransformRequest ¶
func (t *MessageTransformer) TransformRequest(r *http.Request, body []byte) (*adapters.TypedFact, error)
TransformRequest transforms an HTTP request to a TypedFact
Click to show internal directories.
Click to hide internal directories.