Server and client stubs.

Implemented HTTP server with configuration getting stub.

Implemented CLI client with configuration getting stub.
This commit is contained in:
2019-10-05 21:53:22 +05:00
parent 4d79c8da4b
commit 83a8694061
17 changed files with 549 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
package serverv1
import (
// stdlib
"net/http"
// other
"github.com/labstack/echo"
)
// This function responsible for getting runtime configuration.
func configurationGET(ec echo.Context) error {
return ec.JSON(http.StatusOK, map[string]string{"result": "success"})
}

View File

@@ -0,0 +1,21 @@
package serverv1
import (
// local
"sources.dev.pztrn.name/pztrn/giredore/internal/httpserver"
"sources.dev.pztrn.name/pztrn/giredore/internal/logger"
// other
"github.com/rs/zerolog"
)
var (
log zerolog.Logger
)
func Initialize() {
log = logger.Logger.With().Str("type", "domain").Str("package", "server").Int("version", 1).Logger()
log.Info().Msg("Initializing...")
httpserver.Srv.GET("/_api/configuration", configurationGET)
}