provider

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPManager

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

HTTPManager represents the various methods for interacting with Pigeon.

func NewHTTP

func NewHTTP(opts HTTPOpts) (*HTTPManager, error)

NewHTTP initializes a HTTP notification dispatcher object.

func (*HTTPManager) Name

func (m *HTTPManager) Name() string

Name returns the notification provider name.

func (*HTTPManager) Ping

func (m *HTTPManager) Ping(url string, status int) error

Ping does a simple HTTP GET request to the

func (*HTTPManager) Push

func (m *HTTPManager) Push(data []byte) error

Push sends out events to an HTTP Endpoint.

type HTTPOpts

type HTTPOpts struct {
	Log            *logrus.Logger
	RootURL        string
	Timeout        time.Duration
	MaxConnections int

	HealthCheckEnabled bool
	HealthcheckURL     string
	HealthCheckStatus  int
}

type Provider

type Provider interface {
	// Name returns the name of the Provider.
	Name() string
	// Push pushes a batch of event to upstream. The implementation varies across providers.
	Push([]byte) error
	// Ping implements a healthcheck.
	Ping(url string, status int) error
}

Jump to

Keyboard shortcuts

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