app

package
v0.0.0-...-387c587 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(log *slog.Logger, controller controllers.Controller, cfg *config.AppConfig) *App

func (*App) Run

func (a *App) Run() (err error)

type AuthHmac

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

func NewAuthHmacMiddleware

func NewAuthHmacMiddleware(log *slog.Logger, cfg HmacConfig) *AuthHmac

func (*AuthHmac) AuthHmacMiddleware

func (a *AuthHmac) AuthHmacMiddleware(next http.Handler) http.Handler

type HealthHandler

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

func NewHealthHandler

func NewHealthHandler(log *slog.Logger) *HealthHandler

func (*HealthHandler) Get

Get - The app Health

@Summary		This API is there to receive the health of this instance.
@Description	Returns the health of this instance.
@Tags			Health
@Produce		json
@Success		200	{object}	app.Response	"Healthy"
@Failure		500	{object}	app.Response	"Internal Server Error"
@Router			/healthz [get]

func (*HealthHandler) RegisterRoutes

func (h *HealthHandler) RegisterRoutes(r Router)

type HmacConfig

type HmacConfig interface {
	HmacSecret() string
	HmacEnabled() bool
}

type Response

type Response struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func NewResponse

func NewResponse(status int, message string) *Response

func (*Response) ToJson

func (r *Response) ToJson() []byte

func (*Response) WriteResponse

func (r *Response) WriteResponse(w http.ResponseWriter)

type Router

type Router = chi.Router

type SwaggerHandler

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

func NewSwaggerHandler

func NewSwaggerHandler(log *slog.Logger) *SwaggerHandler

func (*SwaggerHandler) Redirect

func (sh *SwaggerHandler) Redirect(w http.ResponseWriter, r *http.Request)

func (*SwaggerHandler) RegisterRoutes

func (sh *SwaggerHandler) RegisterRoutes(r Router)

type WebhookHandler

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

func NewWebhookHandler

func NewWebhookHandler(log *slog.Logger, controller controllers.Controller) *WebhookHandler

func (*WebhookHandler) Post

func (wh *WebhookHandler) Post(w http.ResponseWriter, r *http.Request)

Post - Receives the GitHub webhooks

@Summary		This API is there to receive the GitHub events.
@Description	Once received, this will add them to the event stream for consumers.
@Tags			Webhooks
@Accept			json
@Produce		json
@Success		202	{object} Response	"Successful Response"
@Failure		    401	{object} Response	"Unauthorized"
@Failure		  400	{object} Response		"Bad Request"
@Router			/api/v1/webhook/github [post]

func (*WebhookHandler) RegisterRoutes

func (wh *WebhookHandler) RegisterRoutes(r Router, hmac *AuthHmac)

Jump to

Keyboard shortcuts

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