config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   ServerConfig   `yaml:"server"`
	Webhooks WebhooksConfig `yaml:"webhooks"`
	Logging  LoggingConfig  `yaml:"logging"`
}

Config holds the event-forwarder configuration.

func Load

func Load(path string) (*Config, error)

Load reads config from a YAML file at the given path.

type EndpointConfig

type EndpointConfig struct {
	URL   string       `yaml:"url"`
	Retry *RetryConfig `yaml:"retry,omitempty"`
}

EndpointConfig holds a single webhook endpoint and its (optional) retry policy. When `Retry` is nil, the dispatcher tries exactly once and gives up on failure — the typical Backstage consumer reconciles missed events via its periodic full-sync, so retry isn't needed for the default case. Set this for endpoints that have no equivalent reconciliation mechanism.

type LoggingConfig

type LoggingConfig struct {
	Level  string `yaml:"level"`
	Format string `yaml:"format"`
}

LoggingConfig holds logging settings.

func (LoggingConfig) ToLoggingConfig

func (l LoggingConfig) ToLoggingConfig() logging.Config

ToLoggingConfig converts the YAML-shaped LoggingConfig into the shared logging package's Config so the event-forwarder uses the same logger construction as every other OpenChoreo binary.

type RetryConfig

type RetryConfig struct {
	MaxAttempts int `yaml:"maxAttempts"`
	BackoffMs   int `yaml:"backoffMs"`
}

RetryConfig holds retry settings for a single webhook endpoint.

type ServerConfig

type ServerConfig struct {
	Port int `yaml:"port"`
}

ServerConfig holds HTTP server settings.

type WebhooksConfig

type WebhooksConfig struct {
	Endpoints []EndpointConfig `yaml:"endpoints"`
}

WebhooksConfig holds webhook dispatch settings.

Jump to

Keyboard shortcuts

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