slaxy

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 11 Imported by: 0

README

Slaxy

Sentry webhooks to slack message converter proxy.

Build Status GoDoc Go Report Card Release

Contents

General

Slaxy provides an HTTP web interface that is capable of receiving Sentry webhooks, converting them to Slack messages and posting them to Slack on behalf of a bot user for example. A token is required to authenticate to Slack.

Once the server is up and running it will continuously receive webhooks from Sentry and post them to the configured channel in your Slack workspace.

Installation

You can simply go install the binary that serves as a HTTP server:

$ go install github.com/innogames/slaxy/slaxy

Usage

Example Config
grace-period: 60s
addr: 127.0.0.1:3000
bot-token: xoxb-###-###-###
channel: xxx
excluded-fields:
  - ^sentry:.*$
CLI
  _________.__
 /   _____/|  | _____  ___  ______.__.
 \_____  \ |  | \__  \ \  \/  <   |  |
 /        \|  |__/ __ \_>    < \___  |
/_______  /|____(____  /__/\_ \/ ____|
        \/           \/      \/\/

Usage:
  slaxy [flags]

Flags:
  -a, --addr string               listen address (default "localhost:3000")
  -n, --channel string            slack channel
  -c, --config string             path to config file if any
  -e, --excluded-fields strings   excluded sentry fields
  -g, --grace-period duration     grace period for stopping the server (default 1m0s)
  -h, --help                      help for slaxy
  -t, --token string              slack token

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GracePeriod    time.Duration `mapstructure:"grace-period"`
	Addr           string
	Token          string   `mapstructure:"token"`
	ExcludedFields []string `mapstructure:"excluded-fields"`
}

Config holds all config values

type Logger

type Logger interface {
	Debug(string)
	Debugf(string, ...interface{})
	Info(string)
	Infof(string, ...interface{})
	Warn(string)
	Warnf(string, ...interface{})
	Error(string)
	Errorf(string, ...interface{})
}

Logger defines simple methods for info and debugging messages that could be of interest for the outside

func NewNullLogger

func NewNullLogger() Logger

NewNullLogger returns a new instance of a logger that does nothing

type Server

type Server interface {
	Start() error
	Stop() error
	Errors() <-chan error
}

Server represents a server instance

func New

func New(cfg Config, logger Logger) Server

New creates a new server instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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