config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 4 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 {
	// Log is the logging config
	Log cconfig.Logger `yaml:"log"`
	// Service the service config
	Service Service `yaml:"service"`
	// Kafka is the config for connecting to kafka
	Kafka cconfig.KafkaConfig `yaml:"kafka"`
}

Config contains the configuration for a set of cadence services

func (*Config) String

func (c *Config) String() string

String converts the config object into a string

type Delivery

type Delivery struct {
	// an enum that supports "webhook"
	Method string `yaml:"method"`
	// required when method is "webhook", defines how to deliver notification via webhook
	Webhook Webhook `yaml:"webhook"`
}

Delivery defines how to deliver the notification

type Filter

type Filter struct {
	// filtering based on domains -- notifications of which domain can be sent. Empty means selecting all
	SelectedDomains []string `yaml:"selectedDomains"`
}

type KafkaConsumer

type KafkaConsumer struct {
	// Kafka consumer group name
	ConsumerGroup string `yaml:"consumerGroup"`
	// Kafka topic to send DLQ after maxing out retries
	ConsumerGroupDlqTopic string `yaml:"consumerGroupDlqTopic"`
	// "newest" or "oldest" for consumer group first time to consume
	InitialOffset string `yaml:"initialOffset"`
	// concurrency per app per host, default to 10
	Concurrency int `yaml:"concurrency"`
}

KafkaConsumer defines a consumer from the Kafka topic

type Service

type Service struct {
	// Metrics is the metrics subsystem configuration
	Metrics cconfig.Metrics `yaml:"metrics"`
	// Subscribers is the config for delivering notifications to different subscribers
	Subscribers []Subscriber `yaml:"subscribers"`
}

Service contains the service specific config items

type Subscriber

type Subscriber struct {
	// name of an subscriber application
	Name string `yaml:"name"`
	// Consumer defines a consumer from the Kafka topic
	Consumer KafkaConsumer `yaml:"consumer"`
	// Delivery defines how to deliver the notification
	Delivery Delivery `yaml:"delivery"`
	// filtering notification
	Filter Filter `yaml:"filter"`
}

Subscriber contains config to deliver notifications

type Webhook

type Webhook struct {
	// Callback REST URL. See README for callback request format.
	URL url.URL `yaml:"url"`
	// interval for retry when not receiving 200 from callback
	RetryInterval time.Duration `yaml:"retryInterval"`
	// max number of retries on error(not receiving 200)
	MaxRetries int `yaml:"maxRetries"`
	// context timeout of callback requests
	CallbackRequestTimeout time.Duration `yaml:"callbackRequestTimeout"`
}

Jump to

Keyboard shortcuts

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