mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-07-06 23:22:07 +00:00
* Rename `mizu` to `kubeshark` * Rename `up9inc` to `kubeshark` * Change the logo, title, motto and the main color * Replace the favicon * Update the docs link * Change the copyright text in C files * Remove a comment * Rewrite the `README.md` and update the logo and screenshots used in it * Add a `TODO` * Fix the grammar * Fix the bottom text in the filtering guide * Change the Docker Hub username of cross-compilation intermediate images * Add an install script * Fix `docker/login-action` in the CI * Delete `build-custom-branch.yml` GitHub workflow * Update `README.md` * Remove `install.sh` * Change the motto back to "Traffic viewer for Kubernetes"
32 lines
580 B
Go
32 lines
580 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/kubeshark/kubeshark/shared"
|
|
basenine "github.com/up9inc/basenine/client/go"
|
|
)
|
|
|
|
type ValidateResponse struct {
|
|
Valid bool `json:"valid"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
func PostValidate(c *gin.Context) {
|
|
query := c.PostForm("query")
|
|
valid := true
|
|
message := ""
|
|
|
|
err := basenine.Validate(shared.BasenineHost, shared.BaseninePort, query)
|
|
if err != nil {
|
|
valid = false
|
|
message = err.Error()
|
|
}
|
|
|
|
c.JSON(http.StatusOK, ValidateResponse{
|
|
Valid: valid,
|
|
Message: message,
|
|
})
|
|
}
|