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: 555

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
client command
client command
client command
client command
client command
client command
client command
client command
codec
gob command
gob/client command
iterator command
iterator/client command
protobuf command
protobuf/client command
protobuf/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
client command
client command
client command
failmode
failbackup command
failfast command
failfast/client command
failover command
failover/client command
failtry command
failtry/client command
client command
oneclient command
client command
client command
client command
etcd command
etcd/client command
gomodule module
client command
client command
client command
client command
client command
k8s
client module
server module
k8s_api
client module
server module
k8s_dns
client module
server module
k8s_nacos
client module
server module
kcp
go run -tags kcp server.go
go run -tags kcp server.go
client command
go run -tags kcp client.go
go run -tags kcp client.go
client command
client command
client command
client command
client command
client command
client command
client command
client command
client command
registry
consul command
consul/client command
consul_pool command
etcd command
etcd/client command
etcdv3 command
etcdv3/client command
inprocess command
mdns command
mdns/client command
multiple command
multiple/client command
nacos command
nacos/client command
nacos/server2 command
redis command
redis/client command
zookeeper command
client command
client command
selector
customized command
geo command
geo/client command
hash command
hash/client command
ping command
ping/client command
random command
random/client command
roundrobin command
weighted command
weighted/client command
client command
client command
client command
client command
client command
tls
client command
client command
client command
client command
cmd command

Jump to

Keyboard shortcuts

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