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
102basic
alias
auth
bidirectional
blacklist
breaker
broadcast
codec
protobuf/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
compress
debug_trace
docker
error
failmode
file_download
filetransfer
fork
function
graceful_restart
group
heartbeat
http_invoke
internal_error
ipv6
jsonrpc2
kcp
client
go run -tags kcp client.go
go run -tags kcp client.go
server
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
metrics
nil_panic
nil_reply_client
nil_reply_server
oneclient
oneway
opentelemetry
plugin
pool
quic
client
go run -tags quic client.go
go run -tags quic client.go
server
go run -tags quic .
go run -tags quic .
reconnect
reflection
registry
reqratelimit
restart
reuseport
selector
server_timeout
state
stream
tcpcopy
timeout
tls
unixdomain
websocket
wrapcall

Jump to

Keyboard shortcuts

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