Documentation
¶
Index ¶
Constants ¶
View Source
const (
RegisterAPI = "/basic/register" // 模块注册接口
)
Variables ¶
This section is empty.
Functions ¶
func GatewayPort ¶
GatewayPort returns the gateway port from the environment variable or a free port.
func IsGatewayMode ¶
func IsGatewayMode() bool
IsGatewayMode checks if the application is running in gateway mode. It returns true if GATEWAY_MODE is set to "true" and GATEWAY_PORT is valid.
func ModulePort ¶
ModulePort returns the module port from the environment variable or a free port.
func RegisterModule ¶
RegisterModule registers a module with the gateway.
Types ¶
type RegisterResponse ¶
type RegisterResponse struct {
Code int `json:"code"` // 响应代码
Message string `json:"message"` // 响应信息
Data struct {
Success bool `json:"success"` // 注册是否成功
Message string `json:"message"` // 返回信息
} `json:"data"` // 响应数据
}
RegisterResponse 模块注册响应参数
type RegisterServiceRequest ¶
type RegisterServiceRequest struct {
Secret string `json:"secret"` // 通讯密钥
ProxyPath string `json:"proxy_path"` // 代理路径
ServiceURL string `json:"service_url"` // 服务地址
Repository string `json:"repository"` // 服务代码仓库
ServiceName string `json:"service_name"` // 服务名称
HeartbeatURL string `json:"heartbeat_url"` // 心跳检测地址
ServiceVersion string `json:"service_version"` // 服务版本
}
Click to show internal directories.
Click to hide internal directories.