Initial commit.

This commit is contained in:
2023-10-07 11:14:20 +01:00
parent d3fc632470
commit 39d3afdd05
15 changed files with 513 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package main
import (
"github.com/gookit/goutil/envutil"
libpack_config "github.com/telegram-bot-app/libpack/config"
libpack_logging "github.com/telegram-bot-app/libpack/logging"
)
var cfg *config
func parseConfig() {
libpack_config.PKG_NAME = "graphql_proxy"
var c config
c.Server.PortGraphQL = envutil.GetInt("PORT_GRAPHQL", 8080)
c.Server.PortMonitoring = envutil.GetInt("MONITORING_PORT", 9393)
c.Server.HostGraphQL = envutil.Getenv("HOST_GRAPHQL", "localhost/v1/graphql")
c.Client.JWTUserClaimPath = envutil.Getenv("JWT_USER_CLAIM_PATH", "")
c.Cache.CacheEnable = envutil.GetBool("CACHE_ENABLE", false)
c.Cache.CacheTTL = envutil.GetInt("CACHE_TTL", 60)
c.Logger = libpack_logging.NewLogger()
cfg = &c
enableCache() // takes close to no resources, but can be used with dynamic query cache
}
func main() {
parseConfig()
StartMonitoringServer()
StartHTTPProxy()
}