From 53ba380af29e4d2ccc04d9201d2e948a0bf0bcdd Mon Sep 17 00:00:00 2001 From: Bruce Date: Mon, 1 Apr 2024 17:32:55 +0800 Subject: [PATCH] feat: server pkg (#785) - Expose server-related interface information --- server-v5/api/studio/etc/studio-api.yaml | 4 ++-- server-v5/api/studio/pkg/server/server.go | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 server-v5/api/studio/pkg/server/server.go diff --git a/server-v5/api/studio/etc/studio-api.yaml b/server-v5/api/studio/etc/studio-api.yaml index a37839eb..a03ba6a6 100644 --- a/server-v5/api/studio/etc/studio-api.yaml +++ b/server-v5/api/studio/etc/studio-api.yaml @@ -1,8 +1,8 @@ Name: studio-api Host: 0.0.0.0 Port: 7001 -Timeout: 10000 +Timeout: 30000 Auth: TokenName: "studio_token" TokenSecret: "login_secret" - TokenMaxAge: 259200 + TokenMaxAge: 86400 diff --git a/server-v5/api/studio/pkg/server/server.go b/server-v5/api/studio/pkg/server/server.go new file mode 100644 index 00000000..896a53d4 --- /dev/null +++ b/server-v5/api/studio/pkg/server/server.go @@ -0,0 +1,19 @@ +package server + +import ( + "github.com/vesoft-inc/nebula-studio/server-v5/api/studio/internal/config" + "github.com/vesoft-inc/nebula-studio/server-v5/api/studio/internal/handler" + "github.com/vesoft-inc/nebula-studio/server-v5/api/studio/internal/svc" + "github.com/zeromicro/go-zero/rest" +) + +type ( + ServiceContext = svc.ServiceContext + Config = config.Config +) + +var NewServiceContext = svc.NewServiceContext + +func RegisterHandlers(server *rest.Server, studioSvcCtx *svc.ServiceContext) { + handler.RegisterHandlers(server, studioSvcCtx) +}