resources

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeartbeatMsg = "[]"

	ClientAdrKey = "X-Forwarded-For"
)
View Source
const APIKeyHeaderField = "X-Api-Key"

Variables

This section is empty.

Functions

func History

func History(history dispatch.History, log *logger.UPPLogger) func(w http.ResponseWriter, r *http.Request)

History returns history data

func Stats

func Stats(provider clientsProvider, log *logger.UPPLogger) func(w http.ResponseWriter, r *http.Request)

Stats returns subscriber stats

Types

type HealthCheck

type HealthCheck struct {
	StatusFunc RequestStatusFn
	// contains filtered or unexported fields
}

func NewHealthCheck

func NewHealthCheck(kafkaConsumer KafkaConsumer, apiGatewayGTGAddress string, statusFunc RequestStatusFn) *HealthCheck

func (*HealthCheck) GTG

func (h *HealthCheck) GTG() gtg.Status

func (*HealthCheck) Health

func (h *HealthCheck) Health() func(w http.ResponseWriter, r *http.Request)

type KafkaConsumer

type KafkaConsumer interface {
	ConnectivityCheck() error
}

type KeyErr added in v4.1.2

type KeyErr struct {
	Msg       string
	Status    int
	KeySuffix string
}

func NewKeyErr added in v4.1.2

func NewKeyErr(msg string, status int, key string) *KeyErr

func (*KeyErr) Error added in v4.1.2

func (e *KeyErr) Error() string

type KeyValidator added in v4.1.2

type KeyValidator struct {
	APIGatewayURL string
	// contains filtered or unexported fields
}

func NewKeyValidator added in v4.1.2

func NewKeyValidator(url string, client *http.Client, log *logger.UPPLogger) *KeyValidator

func (*KeyValidator) Validate added in v4.1.2

func (v *KeyValidator) Validate(ctx context.Context, key string) error

type RequestStatusFn added in v4.2.1

type RequestStatusFn func(ctx context.Context, url string) (int, error)

type SubHandler added in v4.1.2

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

SubHandler manages subscription requests

func NewSubHandler added in v4.1.2

func NewSubHandler(n notifier,
	validator keyValidator,
	shutdown onShutdown,
	heartbeatPeriod time.Duration,
	log *logger.UPPLogger) *SubHandler

func (*SubHandler) HandleSubscription added in v4.1.2

func (h *SubHandler) HandleSubscription(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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