example

package module
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

Examples for the latest rpcx

A lot of examples for rpcx

How to run

you should build rpcx with necessary tags, otherwise only need to install rpcx:

go get -u -v github.com/smallnest/rpcx/...

If you install succeefullly, you can run examples in this repository.

Enter one sub directory in this repository, go run server.go in one terminal and cd client; go run client.go in another ternimal, and you can watch the run result.

For example,

cd 101basic
go run server.go

And

cd 101basic/client
go run client.go

Documentation

Overview

Package example defines datastructure and services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	A int
	B int
}

type Arith

type Arith int

func (*Arith) Add

func (t *Arith) Add(ctx context.Context, args *Args, reply *Reply) error

func (*Arith) Mul

func (t *Arith) Mul(ctx context.Context, args *Args, reply *Reply) error

func (*Arith) Say

func (t *Arith) Say(ctx context.Context, args *string, reply *string) error

type Greeter

type Greeter struct{}

func (*Greeter) Say

func (s *Greeter) Say(ctx context.Context, name *string, reply *string) error

type Reply

type Reply struct {
	C int
}

Directories

Path Synopsis
codec
gob
protobuf/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
failmode
kcp
go run -tags kcp server.go
go run -tags kcp server.go
client
go run -tags kcp client.go
go run -tags kcp client.go
registry
selector
geo
tls
cmd

Jump to

Keyboard shortcuts

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