Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
XinsecureDialOption = NewDialOptionBuilder(grpc.WithInsecure())
)
Functions ¶
Types ¶
type DialOptionBuilder ¶
type DialOptionBuilder struct {
// contains filtered or unexported fields
}
func NewDialOptionBuilder ¶
func NewDialOptionBuilder(option grpc.DialOption) *DialOptionBuilder
func (*DialOptionBuilder) ToDialOption ¶
func (this *DialOptionBuilder) ToDialOption() []grpc.DialOption
有一个结构体组, 用来保存多个option. 最后在会返回出去
type Dialer ¶
type Dialer interface { ContextDialer(ctx context.Context, addr string) (net.Conn, error) Dialer(addr string) (net.Conn, error) }
func NewTcpDialer ¶
func NewUnixDialer ¶
----------start----------构造函数----------start----------
type LisAddr ¶
type LisAddr struct { Address string AddressType services.AddressType }
type ScCli ¶
func NewScCli ¶
func NewScCli(info *ServiceInfo, runtimeInfo *ServiceRuntimeInfo) (ScCli, error)
----------start----------构造函数----------start----------
type ServiceInfo ¶
type ServiceInfo struct { // 服务名称 Name string // 服务自定义code Code string // 服务一句话描述信息 Describe string // 服务备注信息 Remark string // 连接地址 Addr string AddrNetwork string // contains filtered or unexported fields }
func NewRandServiceInfo ¶
func NewRandServiceInfo() *ServiceInfo
----------start----------构造函数----------start---------- 随机生成并返回一个serviceInfo
func NewServiceInfo ¶
func NewServiceInfo() *ServiceInfo
func (*ServiceInfo) Serve ¶
func (this *ServiceInfo) Serve(f func(server *grpc.Server))
type ServiceRuntimeInfo ¶
type ServiceRuntimeInfo struct { ServiceId uint32 ServiceVersion uint32 ServiceBootTime int64 ServiceBootCode string // // 监听的地址 Addr net.Addr // contains filtered or unexported fields }
func NewRuntimeInfoWithSI ¶
func NewRuntimeInfoWithSI(info *ServiceInfo) (*ServiceRuntimeInfo, error)
NewRuntimeInfoWithSserviceInfo
func NewServiceRuntimeInfo ¶
func NewServiceRuntimeInfo() *ServiceRuntimeInfo
----------start----------构造函数----------start----------
type SimpleDialer ¶
type SimpleDialer struct {
// contains filtered or unexported fields
}
func (*SimpleDialer) ContextDialer ¶
type SimpleScCli ¶
type SimpleScCli struct {
// contains filtered or unexported fields
}
func (*SimpleScCli) Wait ¶
func (cli *SimpleScCli) Wait() error
Click to show internal directories.
Click to hide internal directories.