genericapi

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AlertStore          alert.Store
	IntegrationKeyStore integrationkey.Store
	HeartbeatStore      heartbeat.Store
	UserStore           user.Store
}

Config contains the values needed to implement the generic API handler.

type Handler

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

Handler responds to generic API requests

func NewHandler

func NewHandler(c Config) *Handler

NewHandler creates a new Handler, registering generic API routes using chi.

func (*Handler) ServeCreateAlert

func (h *Handler) ServeCreateAlert(w http.ResponseWriter, r *http.Request)

ServeCreateAlert allows creating or closing an alert.

func (*Handler) ServeHeartbeatCheck

func (h *Handler) ServeHeartbeatCheck(w http.ResponseWriter, r *http.Request)

ServeHeartbeatCheck serves the heartbeat check-in endpoint.

func (*Handler) ServeUserAvatar

func (h *Handler) ServeUserAvatar(w http.ResponseWriter, req *http.Request)

ServeUserAvatar will serve a redirect for a users avatar image.

Jump to

Keyboard shortcuts

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