mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
// Package grpcx provides grpc service functionalities.
|
|
package grpcx
|
|
|
|
import (
|
|
"github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/balancer"
|
|
"github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/grpcctx"
|
|
"github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/resolver"
|
|
)
|
|
|
|
type (
|
|
modCtx = grpcctx.Ctx
|
|
modBalancer = balancer.Balancer
|
|
modResolver = resolver.Manager
|
|
modClient struct{}
|
|
modServer struct{}
|
|
)
|
|
|
|
const (
|
|
// FreePortAddress marks the server listens using random free port.
|
|
FreePortAddress = ":0"
|
|
)
|
|
|
|
const (
|
|
defaultServerName = `default`
|
|
configNodeNameGrpcServer = `grpc`
|
|
)
|
|
|
|
var (
|
|
Ctx = modCtx{} // Ctx is instance of module Context, which manages the context feature.
|
|
Balancer = modBalancer{} // Balancer is instance of module Balancer, which manages the load balancer features.
|
|
Resolver = modResolver{} // Resolver is instance of module Resolver, which manages the DNS resolving for client.
|
|
Client = modClient{} // Client is instance of module Client, which manages the client features.
|
|
Server = modServer{} // Server is instance of module Server, which manages the server feature.
|
|
)
|