zrpc

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 11 Imported by: 0

README

zrpc

core rpc tool wrap from grpc

quick start

test_test.go

Documentation

Index

Constants

View Source
const (
	ADDRESS = "localhost:5205"
)
View Source
const PORT = ":5205"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(addr string) *Client

func (*Client) Call

func (c *Client) Call(handler string, arg interface{}, reply interface{}) bool

type Gob

type Gob struct {
}

func NewGobObject

func NewGobObject() *Gob

func (*Gob) Decode

func (g *Gob) Decode(data []byte, e interface{}) error

func (*Gob) Encode

func (g *Gob) Encode(e interface{}) ([]byte, error)

func (*Gob) RegisterName

func (g *Gob) RegisterName(name string, v interface{})

type Handler

type Handler struct {
	Func      reflect.Value
	NParams   int
	NReturn   int
	ArgsType  reflect.Type // maybe nil
	ReplyType reflect.Type // maybe nil
}

Func(ctx context.Context, Args ArgsType, ReplyType)

type Server

type Server struct {
	pb.UnimplementedRPCServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string) *Server

func (*Server) Call

func (s *Server) Call(ctx context.Context, request *pb.Request) (*pb.Response, error)

func (*Server) Register

func (s *Server) Register(service interface{})

func (*Server) Start

func (s *Server) Start()

type Service

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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