http

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (*HTTPSource) Stop

func (h *HTTPSource) Stop(ctx context.Context) error

Stop implements FactSource.Stop

func (*HTTPSource) Subscribe

func (h *HTTPSource) Subscribe(ctx context.Context, factTypes []string) (<-chan *adapters.TypedFact, error)

Subscribe implements FactSource.Subscribe

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL