pkg

package
v0.0.0-...-d0c55f3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AMQPHandler

func AMQPHandler(msg *message.Message) ([]*message.Message, error)

AMQPHandler receives a deployment message over AMQP and translates it into a commitDeployed event.

func GithubWebhookHandler

func GithubWebhookHandler(msg *message.Message) ([]*message.Message, error)

GithubWebhookHandler receives GitHub webhooks and translates each commit details into a commitPushed event.

func GrafanaHandler

func GrafanaHandler(msg *message.Message) ([]*message.Message, error)

GrafanaHandler receives an event and translates it into an annotation payload compatible with Grafana REST API.

func GrafanaMarshaller

func GrafanaMarshaller(credentials string) http.MarshalMessageFunc

func SetupRouter

func SetupRouter(router *message.Router, c Config, logger watermill.LoggerAdapter) error

func SlackHandler

func SlackHandler(msg *message.Message) ([]*message.Message, error)

SlackHandler receives an event and translates it into a message payload compatible with Slack REST API.

func SlackMarshaller

func SlackMarshaller(url string, msg *message.Message) (*http.Request, error)

Types

type Config

type Config struct {
	BindAddr        string
	MetricsBindAddr string

	AMQPURI   string
	AMQPQueue string

	KafkaBrokers []string
	KafkaTopic   string

	GrafanaURL         string
	GrafanaCredentials string

	SlackWebhookURL string
}

func LoadConfig

func LoadConfig() Config

type DeploySimulator

type DeploySimulator struct {
	Env   string
	Delay time.Duration
}

DeploySimulator simulates deployment messages for each commitPushed event.

func (DeploySimulator) Handle

func (d DeploySimulator) Handle(msg *message.Message) ([]*message.Message, error)

Handle receives a commitPushed event, waits for chosen duration and produces a commitDeployed event.

Jump to

Keyboard shortcuts

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