lib

package
v0.0.0-...-f10d331 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPCPort     = ":50050"
	RPCAddress  = "127.0.0.1:50050"
	GRPCPort    = ":50051"
	GRPCAddress = "127.0.0.1:50051"
)

Variables

View Source
var GRPCCalClient pb.CalculatorClient
View Source
var RPCCalClient *rpc.Client

Functions

func NewGRPCClient

func NewGRPCClient()

func NewGRPCServer

func NewGRPCServer() *grpc.Server

func NewRPCClient

func NewRPCClient()

func NewRPCServer

func NewRPCServer() *rpc.Server

Types

type GRPCCalServer

type GRPCCalServer struct{}

func (*GRPCCalServer) Div

func (s *GRPCCalServer) Div(ctx context.Context, in *pb.CalRequest) (*pb.DivResult, error)

func (*GRPCCalServer) Mult

func (s *GRPCCalServer) Mult(ctx context.Context, in *pb.CalRequest) (*pb.MultResult, error)

type MyMethod

type MyMethod int

rpc

func (*MyMethod) Div

func (m *MyMethod) Div(args *RArgs, reply *RDivResult) error

func (*MyMethod) Mult

func (m *MyMethod) Mult(args *RArgs, reply *int) error

type RArgs

type RArgs struct {
	A int
	B int
}

type RDivResult

type RDivResult struct {
	Result int
	Mod    int
}

Jump to

Keyboard shortcuts

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