example

package module
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 7 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

func GetCpuLoad added in v1.1.8

func GetCpuLoad() (lod int)

func GetHostAll added in v1.1.8

func GetHostAll() (info map[string]string)

func GetHostIp added in v1.1.8

func GetHostIp() (ips string)

func GetMemInfo added in v1.1.8

func GetMemInfo() (free float64)

Types

type Args

type Args struct {
	A int
	B int
}

type Arith

type Arith int

func (*Arith) Chen

func (t *Arith) Chen(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
	C map[string]string
}

Directories

Path Synopsis
101basic
client command
client/async command
server command
102basic
client command
server command
alias
client command
server command
auth
client command
server command
bidirectional
client command
client/client command
server command
blacklist
client command
server command
breaker
client command
server command
broadcast
client command
server command
codec
gob/client command
gob/server command
iterator/client command
iterator/server command
protobuf/client command
protobuf/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
protobuf/server command
compress
client command
server command
debug_trace
client command
server command
docker
client command
server command
error
client command
server command
failmode
failfast/client command
failfast/server command
failover/client command
failover/server command
failtry/client command
failtry/server command
file_download
client command
oneclient command
server command
filetransfer
client command
server command
fork
client command
server command
function
client command
server command
graceful_restart
client command
server command
group
client command
server command
heartbeat
client command
server command
http_invoke
client command
client/client command
server command
internal_error
client command
server command
ipv6
client command
server command
jsonrpc2
server command
kcp
client command
go run -tags kcp client.go
go run -tags kcp client.go
server command
go run -tags kcp server.go
go run -tags kcp server.go
go run -tags kcp server.go
go run -tags kcp server.go
metadata
client command
server command
metrics
client command
server command
nil_panic
client command
server command
nil_reply_client
client command
server command
nil_reply_server
client command
server command
oneclient
client command
server command
oneway
client command
server command
opentelemetry
client command
server command
plugin
client command
server command
pool
client command
server command
quic
client command
go run -tags quic client.go
go run -tags quic client.go
server command
go run -tags quic .
go run -tags quic .
reconnect
client command
server command
reflection
client command
server command
registry
consul/client command
consul/server command
dns/client command
dns/server command
mdns/client command
mdns/server command
multiple/client command
multiple/server command
nacos/client command
nacos/server command
redis/client command
redis/server command
reqratelimit
client command
server command
restart
client command
server command
reuseport
client command
server command
selector
geo/client command
geo/server command
hash/client command
hash/server command
ping/client command
ping/server command
random/client command
random/server command
weighted/client command
weighted/server command
server_timeout
client command
server command
state
client command
server command
stream
client command
server command
tcpcopy
client command
server command
timeout
client command
server command
tls
client command
server command
unixdomain
client command
server command
websocket
client command
server command
wrapcall
client command
server command

Jump to

Keyboard shortcuts

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