models

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: LGPL-3.0 Imports: 9 Imported by: ? 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

View Source
const (
	DeliveryAttemptStatusOK     = "ok"
	DeliveryAttemptStatusFailed = "failed"
)
View Source
const (
	SinkTypeHttp = "http"
)
View Source
const (
	SourceTypeHttp = "http"
)
View Source
const (
	TransformTypeJavascript = "javascript"
)

Variables

View Source
var HMACAlgorithms = []HMACAlgorithm{
	HMACAlgorithmSHA256,
}
View Source
var SinkTypes = []SinkType{
	SinkTypeHttp,
}
View Source
var SourceTypes = []SourceType{
	SourceTypeHttp,
}
View Source
var VerificationTypes = []VerificationType{
	VerificationTypeHMAC,
}

Functions

func ValidateInhooksConfig

func ValidateInhooksConfig(appConf *lib.AppConfig, c *InhooksConfig) error

ValidateInhooksConfig validates inhooks config and sets defaults

Types

type DeliveryAttempt

type DeliveryAttempt struct {
	At     time.Time             `json:"at"`
	Status DeliveryAttemptStatus `json:"status"`
	Error  string                `json:"error"`
}

type DeliveryAttemptStatus

type DeliveryAttemptStatus string

type Flow

type Flow struct {
	ID     string  `yaml:"id"`
	Source *Source `yaml:"source"`
	Sinks  []*Sink `yaml:"sinks"`
}

type HMACAlgorithm added in v0.1.6

type HMACAlgorithm string
const (
	HMACAlgorithmSHA256 HMACAlgorithm = "sha256"
)

type InhooksConfig

type InhooksConfig struct {
	Flows                []*Flow                `yaml:"flows"`
	TransformDefinitions []*TransformDefinition `yaml:"transform_definitions"`
}

type Message

type Message struct {
	ID       string `json:"id"`
	FlowID   string `json:"flowID"`
	SourceID string `json:"sourceID"`
	// Ingested Request ID
	IngestedReqID string      `json:"ingestedReqID"`
	SinkID        string      `json:"sinkID"`
	HttpHeaders   http.Header `json:"httpHeaders"`
	RawQuery      string      `json:"rawQuery"`
	Payload       []byte      `json:"payload"`

	// Processing Info
	DeliveryAttempts []*DeliveryAttempt `json:"deliveryAttempts"`
	DeliverAfter     time.Time
}

type MessageStatus

type MessageStatus string

type QueueStatus

type QueueStatus string
const (
	QueueStatusScheduled  QueueStatus = "scheduled"
	QueueStatusReady      QueueStatus = "ready"
	QueueStatusProcessing QueueStatus = "processing"
	QueueStatusDone       QueueStatus = "done"
	QueueStatusDead       QueueStatus = "dead"
)

type QueuedInfo added in v0.1.2

type QueuedInfo struct {
	MessageID    string
	QueueStatus  QueueStatus
	DeliverAfter time.Time
}

type RateLimitConfig added in v0.1.14

type RateLimitConfig struct {
	Capacity       int           `yaml:"capacity"`
	RefillRate     int           `yaml:"refillRate"`
	RefillInterval time.Duration `yaml:"refillInterval"`
}

func (*RateLimitConfig) Validate added in v0.1.14

func (r *RateLimitConfig) Validate() error

type RateLimitDecision added in v0.1.14

type RateLimitDecision struct {
	Allowed    bool
	Remaining  float64
	RetryAfter time.Duration
}

type Sink

type Sink struct {
	// Sink ID
	ID string `yaml:"id"`
	// Sink Type
	Type SinkType `yaml:"type"`
	// Sink Url for HTTP sinks
	URL string `yaml:"url"`
	// Process after delay
	Delay *time.Duration `yaml:"delay"`
	// Retry every x time
	RetryInterval *time.Duration `yaml:"retryInterval"`
	// Retry exponential multiplier. 1 is constant backoff. Set to > 1 for exponential backoff.
	RetryExpMultiplier *float64 `yaml:"retryExpMultiplier"`
	// Max attempts
	MaxAttempts *int `yaml:"maxAttempts"`
	// Transform to apply to the data
	Transform *Transform `yaml:"transform"`
	// Outbound rate limit (token bucket). Optional.
	RateLimit *RateLimitConfig `yaml:"rateLimit,omitempty"`
}

type SinkType

type SinkType string

type Source

type Source struct {
	ID           string        `yaml:"id"`
	Slug         string        `yaml:"slug"`
	Type         SourceType    `yaml:"type"`
	Verification *Verification `yaml:"verification"`
}

type SourceType

type SourceType string

type Transform added in v0.1.9

type Transform struct {
	ID string `yaml:"id"`
}

type TransformDefinition added in v0.1.9

type TransformDefinition struct {
	ID         string        `yaml:"id"`
	Type       TransformType `yaml:"type"`
	Script     string        `yaml:"script"`
	ScriptPath string        `yaml:"script_path"`
}

type TransformType added in v0.1.9

type TransformType string

type Verification added in v0.1.6

type Verification struct {
	VerificationType     VerificationType `yaml:"verificationType"`
	HMACAlgorithm        *HMACAlgorithm   `yaml:"hmacAlgorithm"`
	SignatureHeader      string           `yaml:"signatureHeader"`
	SignaturePrefix      string           `yaml:"signaturePrefix"`
	CurrentSecretEnvVar  string           `yaml:"currentSecretEnvVar"`
	PreviousSecretEnvVar string           `yaml:"previousSecretEnvVar"`
}

type VerificationType added in v0.1.6

type VerificationType string
const (
	VerificationTypeHMAC VerificationType = "hmac"
)

Jump to

Keyboard shortcuts

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