package
1.0.5
Repository: https://github.com/squarex-labs/adk.git
Documentation: pkg.go.dev

# README

api

Custom http.Handler types which handles errors.AppError gracefully in oneplace.

type Handler func(w http.ResponseWriter, r *http.Request) *errors.AppError

# Functions

Decode - decodes the request body and extends the validator interface with the Validate() method EX: type User struct { Email string `json:"email"` Name string `json:"name"` } func (c *Component) Validate() *errors.AppError { if c.Email == "" { return errors.IsRequiredErr("email") } return nil }.
HealthHandeler return basic service info.
IndexHandeler common index handler for all the service.
InitService sets the service name.
InitSlackWebhook sets the slack webhook url.
JustDecode just decodes the request body.

# Variables

FormDecoder gorrila schema decoder is used to decode form data & query params into structs.
RequestIDHeader is the name of the HTTP Header which contains the request id.
ServiceName holds the service which connected to.

# Structs

ServiceInfo stores basic service information.

# Type aliases

Handler custom api handler help us to handle all the errors in one place.