handler

package
v0.0.0-...-a016e7d Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, conf *Config) (*http.ServeMux, error)

Types

type Config

type Config struct {
	// path to global template files
	Templates []string          `json:"templates,omitempty"`
	Receivers []*ReceiverConfig `json:"receivers,omitempty"`
}

type Receiver

type Receiver struct {
	// contains filtered or unexported fields
}

func NewReceiver

func NewReceiver(tmpl *template.Template, conf *ReceiverConfig) (*Receiver, error)

func (*Receiver) NewMessage

func (d *Receiver) NewMessage(ctx context.Context, r io.Reader) error

type ReceiverConfig

type ReceiverConfig struct {
	// name should be a valid dns label, and identical
	Name              string            `json:"name,omitempty"`
	URL               config.URL        `json:"url,omitempty"`
	Body              string            `json:"body,omitempty"`
	AdditionalHeaders map[string]string `json:"additional_headers,omitempty"`
	DownstreamTimeout duration.Duration `json:"downstream_timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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