rpcx

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 17 Imported by: 0

README

xxx

介绍
  1. xxxx
  2. xxxx
  3. xxxx
安装教程

go get github.com/jageros/hawox

使用例子
package main

import (
	"fmt"
	"github.com/jageros/hawox/xxx"
)

func main() {
	/*
	xxxxx
	xxxxx
	xxxxx
	*/
}
使用说明
  1. xxxx
  2. xxxx
  3. xxxx

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallByName

func CallByName(serviceName string, rpcFn RpcFn) errcode.IErr

func InitClient

func InitClient(ctx contextx.Context, d registry.Discovery, opfs ...func(cfctx Config))

func RegistryRpcServer

func RegistryRpcServer(s *grpc.Server)

Types

type Config

type Config interface {
	SetCallTimeout(callTimeout time.Duration)
}

type Option

type Option struct {
	ID           string
	Name         string
	Ip           string
	Port         int // 端口最大值:65535
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	CloseTimeout time.Duration
	Registrar    registry.Registrar // 服务注册接口
	Endpoint     string
}

type RpcFn

type RpcFn func(cc *grpc.ClientConn)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx contextx.Context, opfs ...func(opt *Option)) *Server

func (*Server) RegistryService

func (s *Server) RegistryService(registryFunc func(svr *grpc.Server))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL