example

package module
v0.0.0-...-4d5c92d Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

RPCWork

  1. Create project
echo "# RPCWork" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/bigdot123456/RPCWork.git
git push -u origin master
  1. notice

server should listen all ip, as this code :

var (
	addr = flag.String("addr", "0.0.0.0:8972", "server address")
)

localhost is an error for other ip access

Examples for rpcx 3.0

A lot of examples for rpcx 3.0

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 want to use "zookeeper" registry, you need to add tag zookeeper,

go get -u -v -tags "zookeeper" github.com/smallnest/rpcx/...

Similarly, if you want to use etcd registry and quic network, you need to :

go get -u -v -tags "etcd quic" github.com/smallnest/rpcx/...

You can install all features of rpcx with those below tags:

go get -u -v -tags "zookeeper etcd consul ping quic kcp reuseport" 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 Reply

type Reply struct {
	C int
}

Directories

Path Synopsis
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
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
go run -tags etcd server.go
go run -tags etcd server.go
etcd/client command
go run -tags etcd client.go
go run -tags etcd client.go
client command
client command
client command
client command
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
go run -tags quic server.go
go run -tags quic server.go
client command
go run -tags quic client.go
go run -tags quic client.go
client command
registry
consul command
go run -tags consul server.go
go run -tags consul server.go
consul/client command
consul_pool command
go run -tags consul server.go
go run -tags consul server.go
dynamic_port_allocation command
go run -tags etcd server.go
go run -tags etcd server.go
dynamic_port_allocation/client command
go run -tags etcd client.go
go run -tags etcd client.go
etcd command
go run -tags etcd server.go go run -tags etcd server.go
go run -tags etcd server.go go run -tags etcd server.go
etcd/client command
go run -tags etcd client.go
go run -tags etcd client.go
etcdv3 command
go run -tags etcd server.go
go run -tags etcd server.go
etcdv3/client command
go run -tags etcd client.go
go run -tags etcd client.go
inprocess command
go run -tags etcd server.go
go run -tags etcd server.go
mdns command
mdns/client command
go run -tags etcd client.go
go run -tags etcd client.go
multiple command
multiple/client command
redis command
go run -tags etcd server.go
go run -tags etcd server.go
redis/client command
go run -tags etcd client.go
go run -tags etcd client.go
zookeeper command
go run -tags zookeeper server.go
go run -tags zookeeper server.go
zookeeper/client command
go run -tags zookeeper client.go
go run -tags zookeeper client.go
client command
Package example defines datastructure and services.
Package example defines datastructure and services.
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
tls
client command
client command
client command
utp
go run -tags rudp server.go
go run -tags rudp server.go
client command
go run -tags rudp client.go
go run -tags rudp client.go
cmd command

Jump to

Keyboard shortcuts

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