func adminMiddleware(c *gin.Context) {
	secret := c.Request.Header.Get("Secret")
	if secret == "" {
		c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"error": ErrCodeSecretMissing})
		return
	}
	if secret != config.Config.API.Secret {
		c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"error": ErrCodeInvalidSecret})
		return
	}
	c.Next()
}
adminMiddleware checks the request headers for secret key provided in config file.
package api
import (
	"github.com/Navid2zp/citus-failover/config"
	"github.com/Navid2zp/citus-failover/logging"
	"github.com/gin-gonic/gin"
	"log"
	"net/http"
)
var logger *logging.Logger
func initAPI() {
	logger = logging.NewLogger("api")
	if !config.Config.Settings.Debug {
		gin.SetMode(gin.ReleaseMode)
	}
}