An efficient, extensible and easy-to-use RPC framework.

eRPC GitHub release report card github issues github closed issues GoDoc view examples

eRPC is an efficient, extensible and easy-to-use RPC framework.

Suitable for RPC, Microservice, Peer-to-Peer, IM, Game and other fields.

简体中文

eRPC-Framework

Install

  • go vesion ≥ 1.11

  • install

GO111MODULE=on go get -u -v -insecure github.com/henrylee2cn/erpc/v6
  • import
import "github.com/henrylee2cn/erpc/v6"

Feature

  • Use peer to provide the same API package for the server and client
  • Provide multi-layout abstractions such as:
    • peer
    • session/socket
    • router
    • handle/context
    • message
    • protocol
    • codec
    • transfer filter
    • plugin
  • Support reboot and shutdown gracefully
  • HTTP-compatible message format:
    • Composed of two parts, the Header and the Body
    • Header contains metadata in the same format as HTTP header
    • Body supports for custom codec of Content Type-Like, already implemented:
      • Protobuf
      • Thrift
      • JSON
      • XML
      • Form
      • Plain
    • Support push, call-reply and more message types
  • Support custom message protocol, and provide some common implementations:
    • rawproto - Default high performance binary protocol
    • jsonproto - JSON message protocol
    • pbproto - Ptotobuf message protocol
    • thriftproto - Thrift message protocol
    • httproto - HTTP message protocol
  • Optimized high performance transport layer
    • Use Non-block socket and I/O multiplexing technology
    • Support setting the size of socket I/O buffer
    • Support setting the size of the reading message (if exceed disconnect it)
    • Support controling the connection file descriptor
  • Support a variety of network types:
    • tcp
    • tcp4
    • tcp6
    • unix
    • unixpacket
    • kcp
    • quic
    • other
      • websocket
      • evio
  • Provide a rich plug-in point, and already implemented:
    • auth
    • binder
    • heartbeat
    • ignorecase(service method)
    • overloader
    • proxy(for unknown service method)
    • secure
  • Powerful and flexible logging system:
    • Detailed log information, support print input and output details
    • Support setting slow operation alarm threshold
    • Support for custom implementation log component
  • Client session support automatically redials after disconnection

Benchmark

Self Test

  • A server and a client process, running on the same machine

  • CPU: Intel Xeon E312xx (Sandy Bridge) 16 cores 2.53GHz

  • Memory: 16G

  • OS: Linux 2.6.32-696.16.1.el6.centos.plus.x86_64, CentOS 6.4

  • Go: 1.9.2

  • Message size: 581 bytes

  • Message codec: protobuf

  • Sent total 1000000 messages

  • erpc

client concurrency mean(ms) median(ms) max(ms) min(ms) throughput(TPS)
100 1 0 16 0 75505
500 9 11 97 0 52192
1000 19 24 187 0 50040
2000 39 54 409 0 42551
5000 96 128 1148 0 46367
  • erpc/socket
client concurrency mean(ms) median(ms) max(ms) min(ms) throughput(TPS)
100 0 0 14 0 225682
500 2 1 24 0 212630
1000 4 3 51 0 180733
2000 8 6 64 0 183351
5000 21 18 651 0 133886

Comparison Test

Environment Throughputs Mean Latency P99 Latency

More Detail

  • Profile torch of erpc/socket

erpc_socket_profile_torch

svg file

  • Heap torch of erpc/socket

erpc_socket_heap_torch

svg file

Example

server.go

package main

import (
	"fmt"
	"time"

	"github.com/henrylee2cn/erpc/v6"
)

func main() {
	defer erpc.FlushLogger()
	// graceful
	go erpc.GraceSignal()

	// server peer
	srv := erpc.NewPeer(erpc.PeerConfig{
		CountTime:   true,
		ListenPort:  9090,
		PrintDetail: true,
	})
	// srv.SetTLSConfig(erpc.GenerateTLSConfigForServer())

	// router
	srv.RouteCall(new(Math))

	// broadcast per 5s
	go func() {
		for {
			time.Sleep(time.Second * 5)
			srv.RangeSession(func(sess erpc.Session) bool {
				sess.Push(
					"/push/status",
					fmt.Sprintf("this is a broadcast, server time: %v", time.Now()),
				)
				return true
			})
		}
	}()

	// listen and serve
	srv.ListenAndServe()
}

// Math handler
type Math struct {
	erpc.CallCtx
}

// Add handles addition request
func (m *Math) Add(arg *[]int) (int, *erpc.Status) {
	// test meta
	erpc.Infof("author: %s", m.PeekMeta("author"))
	// add
	var r int
	for _, a := range *arg {
		r += a
	}
	// response
	return r, nil
}

client.go

package main

import (
	"time"

	"github.com/henrylee2cn/erpc/v6"
)

func main() {
	defer erpc.SetLoggerLevel("ERROR")()

	cli := erpc.NewPeer(erpc.PeerConfig{})
	defer cli.Close()
	// cli.SetTLSConfig(&tls.Config{InsecureSkipVerify: true})

	cli.RoutePush(new(Push))

	sess, stat := cli.Dial(":9090")
	if !stat.OK() {
		erpc.Fatalf("%v", stat)
	}

	var result int
	stat = sess.Call("/math/add",
		[]int{1, 2, 3, 4, 5},
		&result,
		erpc.WithAddMeta("author", "henrylee2cn"),
	).Status()
	if !stat.OK() {
		erpc.Fatalf("%v", stat)
	}
	erpc.Printf("result: %d", result)
	erpc.Printf("Wait 10 seconds to receive the push...")
	time.Sleep(time.Second * 10)
}

// Push push handler
type Push struct {
	erpc.PushCtx
}

// Push handles '/push/status' message
func (p *Push) Status(arg *string) *erpc.Status {
	erpc.Printf("%s", *arg)
	return nil
}

More Examples

Usage

Peer(server or client) Demo

// Start a server
var peer1 = erpc.NewPeer(erpc.PeerConfig{
    ListenPort: 9090, // for server role
})
peer1.Listen()

...

// Start a client
var peer2 = erpc.NewPeer(erpc.PeerConfig{})
var sess, err = peer2.Dial("127.0.0.1:8080")

Call-Struct API template

type Aaa struct {
    erpc.CallCtx
}
func (x *Aaa) XxZz(arg *<T>) (<T>, *erpc.Status) {
    ...
    return r, nil
}
  • register it to root router:
// register the call route
// HTTP mapping: /aaa/xx_zz
// RPC mapping: Aaa.XxZz
peer.RouteCall(new(Aaa))

// or register the call route
// HTTP mapping: /xx_zz
// RPC mapping: XxZz
peer.RouteCallFunc((*Aaa).XxZz)

Service method mapping

  • The default mapping(HTTPServiceMethodMapper) of struct(func) name to service methods:

    • AaBb -> /aa_bb
    • ABcXYz -> /abc_xyz
    • Aa__Bb -> /aa_bb
    • aa__bb -> /aa_bb
    • ABC__XYZ -> /abc_xyz
    • Aa_Bb -> /aa/bb
    • aa_bb -> /aa/bb
    • ABC_XYZ -> /abc/xyz
    erpc.SetServiceMethodMapper(erpc.HTTPServiceMethodMapper)
  • The mapping(RPCServiceMethodMapper) of struct(func) name to service methods:

    • AaBb -> AaBb
    • ABcXYz -> ABcXYz
    • Aa__Bb -> Aa_Bb
    • aa__bb -> aa_bb
    • ABC__XYZ -> ABC_XYZ
    • Aa_Bb -> Aa.Bb
    • aa_bb -> aa.bb
    • ABC_XYZ -> ABC.XYZ
    erpc.SetServiceMethodMapper(erpc.RPCServiceMethodMapper)

Call-Function API template

func XxZz(ctx erpc.CallCtx, arg *<T>) (<T>, *erpc.Status) {
    ...
    return r, nil
}
  • register it to root router:
// register the call route
// HTTP mapping: /xx_zz
// RPC mapping: XxZz
peer.RouteCallFunc(XxZz)

Push-Struct API template

type Bbb struct {
    erpc.PushCtx
}
func (b *Bbb) YyZz(arg *<T>) *erpc.Status {
    ...
    return nil
}
  • register it to root router:
// register the push handler
// HTTP mapping: /bbb/yy_zz
// RPC mapping: Bbb.YyZz
peer.RoutePush(new(Bbb))

// or register the push handler
// HTTP mapping: /yy_zz
// RPC mapping: YyZz
peer.RoutePushFunc((*Bbb).YyZz)

Push-Function API template

// YyZz register the handler
func YyZz(ctx erpc.PushCtx, arg *<T>) *erpc.Status {
    ...
    return nil
}
  • register it to root router:
// register the push handler
// HTTP mapping: /yy_zz
// RPC mapping: YyZz
peer.RoutePushFunc(YyZz)

Unknown-Call-Function API template

func XxxUnknownCall (ctx erpc.UnknownCallCtx) (interface{}, *erpc.Status) {
    ...
    return r, nil
}
  • register it to root router:
// register the unknown call route: /*
peer.SetUnknownCall(XxxUnknownCall)

Unknown-Push-Function API template

func XxxUnknownPush(ctx erpc.UnknownPushCtx) *erpc.Status {
    ...
    return nil
}
  • register it to root router:
// register the unknown push route: /*
peer.SetUnknownPush(XxxUnknownPush)

Plugin Demo

// NewIgnoreCase Returns a ignoreCase plugin.
func NewIgnoreCase() *ignoreCase {
    return &ignoreCase{}
}

type ignoreCase struct{}

var (
    _ erpc.PostReadCallHeaderPlugin = new(ignoreCase)
    _ erpc.PostReadPushHeaderPlugin = new(ignoreCase)
)

func (i *ignoreCase) Name() string {
    return "ignoreCase"
}

func (i *ignoreCase) PostReadCallHeader(ctx erpc.ReadCtx) *erpc.Status {
    // Dynamic transformation path is lowercase
    ctx.UriObject().Path = strings.ToLower(ctx.UriObject().Path)
    return nil
}

func (i *ignoreCase) PostReadPushHeader(ctx erpc.ReadCtx) *erpc.Status {
    // Dynamic transformation path is lowercase
    ctx.UriObject().Path = strings.ToLower(ctx.UriObject().Path)
    return nil
}

Register above handler and plugin

// add router group
group := peer.SubRoute("test")
// register to test group
group.RouteCall(new(Aaa), NewIgnoreCase())
peer.RouteCallFunc(XxZz, NewIgnoreCase())
group.RoutePush(new(Bbb))
peer.RoutePushFunc(YyZz)
peer.SetUnknownCall(XxxUnknownCall)
peer.SetUnknownPush(XxxUnknownPush)

Config

type PeerConfig struct {
    Network            string        `yaml:"network"              ini:"network"              comment:"Network; tcp, tcp4, tcp6, unix, unixpacket, kcp or quic"`
    LocalIP            string        `yaml:"local_ip"             ini:"local_ip"             comment:"Local IP"`
    ListenPort         uint16        `yaml:"listen_port"          ini:"listen_port"          comment:"Listen port; for server role"`
    DialTimeout time.Duration `yaml:"dial_timeout" ini:"dial_timeout" comment:"Default maximum duration for dialing; for client role; ns,µs,ms,s,m,h"`
    RedialTimes        int32         `yaml:"redial_times"         ini:"redial_times"         comment:"The maximum times of attempts to redial, after the connection has been unexpectedly broken; Unlimited when <0; for client role"`
	RedialInterval     time.Duration `yaml:"redial_interval"      ini:"redial_interval"      comment:"Interval of redialing each time, default 100ms; for client role; ns,µs,ms,s,m,h"`
    DefaultBodyCodec   string        `yaml:"default_body_codec"   ini:"default_body_codec"   comment:"Default body codec type id"`
    DefaultSessionAge  time.Duration `yaml:"default_session_age"  ini:"default_session_age"  comment:"Default session max age, if less than or equal to 0, no time limit; ns,µs,ms,s,m,h"`
    DefaultContextAge  time.Duration `yaml:"default_context_age"  ini:"default_context_age"  comment:"Default CALL or PUSH context max age, if less than or equal to 0, no time limit; ns,µs,ms,s,m,h"`
    SlowCometDuration  time.Duration `yaml:"slow_comet_duration"  ini:"slow_comet_duration"  comment:"Slow operation alarm threshold; ns,µs,ms,s ..."`
    PrintDetail        bool          `yaml:"print_detail"         ini:"print_detail"         comment:"Is print body and metadata or not"`
    CountTime          bool          `yaml:"count_time"           ini:"count_time"           comment:"Is count cost time or not"`
}

Optimize

  • SetMessageSizeLimit sets max message size. If maxSize<=0, set it to max uint32.

    func SetMessageSizeLimit(maxMessageSize uint32)
  • SetSocketKeepAlive sets whether the operating system should send keepalive messages on the connection.

    func SetSocketKeepAlive(keepalive bool)
  • SetSocketKeepAlivePeriod sets period between keep alives.

    func SetSocketKeepAlivePeriod(d time.Duration)
  • SetSocketNoDelay controls whether the operating system should delay message transmission in hopes of sending fewer messages (Nagle's algorithm). The default is true (no delay), meaning that data is sent as soon as possible after a Write.

    func SetSocketNoDelay(_noDelay bool)
  • SetSocketReadBuffer sets the size of the operating system's receive buffer associated with the connection.

    func SetSocketReadBuffer(bytes int)
  • SetSocketWriteBuffer sets the size of the operating system's transmit buffer associated with the connection.

    func SetSocketWriteBuffer(bytes int)

Extensions

Codec

package import description
json "github.com/henrylee2cn/erpc/v6/codec" JSON codec(erpc own)
protobuf "github.com/henrylee2cn/erpc/v6/codec" Protobuf codec(erpc own)
thrift "github.com/henrylee2cn/erpc/v6/codec" Form(url encode) codec(erpc own)
xml "github.com/henrylee2cn/erpc/v6/codec" Form(url encode) codec(erpc own)
plain "github.com/henrylee2cn/erpc/v6/codec" Plain text codec(erpc own)
form "github.com/henrylee2cn/erpc/v6/codec" Form(url encode) codec(erpc own)

Plugin

package import description
auth "github.com/henrylee2cn/erpc/v6/plugin/auth" An auth plugin for verifying peer at the first time
binder "github.com/henrylee2cn/erpc/v6/plugin/binder" Parameter Binding Verification for Struct Handler
heartbeat "github.com/henrylee2cn/erpc/v6/plugin/heartbeat" A generic timing heartbeat plugin
proxy "github.com/henrylee2cn/erpc/v6/plugin/proxy" A proxy plugin for handling unknown calling or pushing
secure "github.com/henrylee2cn/erpc/v6/plugin/secure" Encrypting/decrypting the message body
overloader "github.com/henrylee2cn/erpc/v6/plugin/overloader" A plugin to protect erpc from overload

Protocol

package import description
rawproto "github.com/henrylee2cn/erpc/v6/proto/rawproto A fast socket communication protocol(erpc default protocol)
jsonproto "github.com/henrylee2cn/erpc/v6/proto/jsonproto" A JSON socket communication protocol
pbproto "github.com/henrylee2cn/erpc/v6/proto/pbproto" A Protobuf socket communication protocol
thriftproto "github.com/henrylee2cn/erpc/v6/proto/thriftproto" A Thrift communication protocol
httproto "github.com/henrylee2cn/erpc/v6/proto/httproto" A HTTP style socket communication protocol

Transfer-Filter

package import description
gzip "github.com/henrylee2cn/erpc/v6/xfer/gzip" Gzip(erpc own)
md5 "github.com/henrylee2cn/erpc/v6/xfer/md5" Provides a integrity check transfer filter

Mixer

package import description
multiclient "github.com/henrylee2cn/erpc/v6/mixer/multiclient" Higher throughput client connection pool when transferring large messages (such as downloading files)
websocket "github.com/henrylee2cn/erpc/v6/mixer/websocket" Makes the eRPC framework compatible with websocket protocol as specified in RFC 6455
evio "github.com/henrylee2cn/erpc/v6/mixer/evio" A fast event-loop networking framework that uses the erpc API layer
html html "github.com/xiaoenai/tp-micro/helper/mod-html" HTML render for http client

Projects based on eRPC

project description
TP-Micro TP-Micro is a simple, powerful micro service framework based on eRPC
Pholcus Pholcus is a distributed, high concurrency and powerful web crawler software

Business Users

深圳市梦之舵信息技术有限公司    平安科技
北京风行在线技术有限公司    北京可即时代网络公司 快手短视频平台

License

eRPC is under Apache v2 License. See the LICENSE file for the full license text

Owner
henrylee2cn
Cease to programing and cease to live.
henrylee2cn
Comments
  • GOARCH=arm 编译失败,存在类型不匹配问题

    GOARCH=arm 编译失败,存在类型不匹配问题

    /gopathdir/pkg/mod/github.com/henrylee2cn/[email protected]/int.go:174:26: constant 4294967295 overflows int /gopathdir/pkg/mod/github.com/henrylee2cn/[email protected]/uint.go:66:8: constant 9223372036854775807 overflows uint /gopathdir/pkg/mod/github.com/henrylee2cn/[email protected]/uint.go:127:7: constant 9223372036854775807 overflows uint Makefile:28: recipe for target 'server_pi' failed

  • c++ client

    c++ client

    可以使用C++客户端连接erpc的服务吗. 这种情况下, erpc服务使用哪种协议比较方便客户端组包或解包? pb、raw? 有没有可能erpc服务自定义数据包的格式. 比如 |len|version|body-bytes-data...| 这样客户端可以比较方便的与服务端做数据交互,而且也提供了自定义协议的能力.

  • 被攻击了...崩溃了..

    被攻击了...崩溃了..

    开始其他人被攻击了,程序直接崩溃了.. 后来看了下没有设置包文的大小,传输过来申请内存直接崩溃了, 后来设置了16MB最大报文,还是崩溃. 发现代码应该是有问题,应该是len可能读取到的小于4,导致申请内存出错,crash了.

    崩溃堆栈: goroutine 87366 [running]: runtime.systemstack_switch() /usr/local/Cellar/[email protected]/1.14.10/libexec/src/runtime/asm_amd64.s:330 fp=0xc00021ab78 sp=0xc00021ab70 pc=0x465c50 runtime.mallocgc(0xfffffffc, 0x119d700, 0x1, 0xc00054e370) /usr/local/Cellar/[email protected]/1.14.10/libexec/src/runtime/malloc.go:1046 +0x895 fp=0xc00021ac18 sp=0xc00021ab78 pc=0x40cd15 runtime.makeslice(0x119d700, 0xfffffffc, 0xfffffffc, 0x0) /usr/local/Cellar/[email protected]/1.14.10/libexec/src/runtime/slice.go:49 +0x6c fp=0xc00021ac48 sp=0xc00021ac18 pc=0x44cd7c github.com/henrylee2cn/erpc/v6/utils.(*ByteBuffer).ChangeLen(...) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/utils/bytebuffer.go:115 github.com/henrylee2cn/erpc/v6/socket.(*rawProto).readMessage(0xc00024c580, 0xc0000da820, 0x16fab00, 0xc000900a80, 0x0, 0x0) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/socket/protocol.go:237 +0x411 fp=0xc00021acc8 sp=0xc00021ac48 pc=0xce7711 github.com/henrylee2cn/erpc/v6/socket.(*rawProto).Unpack(0xc00024c580, 0x16fab00, 0xc000900a80, 0x0, 0x0) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/socket/protocol.go:204 +0x9a fp=0xc00021ad50 sp=0xc00021acc8 pc=0xce710a github.com/henrylee2cn/erpc/v6/socket.(*socket).ReadMessage(0xc0002aa960, 0x16fab00, 0xc000900a80, 0x0, 0x0) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/socket/socket.go:236 +0x73 fp=0xc00021ad98 sp=0xc00021ad50 pc=0xce8533 github.com/henrylee2cn/erpc/v6.(*session).startReadAndHandle(0xc000732300) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/session.go:874 +0x26f fp=0xc00021ae40 sp=0xc00021ad98 pc=0xe1adcf github.com/henrylee2cn/erpc/v6.(*peer).serveListener.func1() /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/peer.go:374 +0x2f8 fp=0xc00021af58 sp=0xc00021ae40 pc=0xe1f698 github.com/henrylee2cn/goutil/pool.(*GoPool).goroutineFunc(0xc00037a770, 0xc0002d6220) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/[email protected]/pool/go_pool.go:265 +0x71 fp=0xc00021af98 sp=0xc00021af58 pc=0xdfbbc1 github.com/henrylee2cn/goutil/pool.(*GoPool).getCh.func1(0xc00037a770, 0xc0002d6220, 0x115a940, 0xc0002d6220) /Users/wangzhilong/goProject/pkg/mod/github.com/henrylee2cn/[email protected]/pool/go_pool.go:241 +0x35 fp=0xc00021afc0 sp=0xc00021af98 pc=0xdfbd75 runtime.goexit()

  • PostDialPlugin:auth-bearer 无法重连

    PostDialPlugin:auth-bearer 无法重连

    您好,当服务端关闭后,客户端有概率出现如下错误,出现错误后重连机制就没有了。

    [2020/05/12 08:00:04.169] [DEBU] [PostDialPlugin:auth-bearer] network:tcp, addr:127.0.0.1:8081, is_redial:true, error:{"code":102,"msg":"Connection Closed","cause":"read tcp 127.0.0.1:60300->127.0.0.1:8081: read: connection reset by peer"}
    [2020/05/12 08:00:04.169] [ERRO] redial fail (network:tcp, addr:127.0.0.1:8081, id:127.0.0.1:60238): {"code":102,"msg":"Connection Closed","cause":"read tcp 127.0.0.1:60300->127.0.0.1:8081: read: connection reset by peer"}
    

    客户端出现如上错误后,不会再重新尝试连接服务端。

  • 6.3.2版本编译失败

    6.3.2版本编译失败

    #84 谢谢快速修订该问题.但是好像新版本存在其他问题

    更新版本6.3.2,出现新的编译错误.

    go 1.14

    require ( github.com/astaxie/beego v1.12.1 github.com/denisbrodbeck/machineid v1.0.1 github.com/go-sql-driver/mysql v1.5.0 github.com/gogo/protobuf v1.3.1 // indirect github.com/golang/protobuf v1.4.0 github.com/henrylee2cn/erpc/v6 v6.3.2 github.com/klauspost/cpuid v1.2.3 // indirect github.com/klauspost/reedsolomon v1.9.3 github.com/lucas-clemente/quic-go v0.15.3 // indirect github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 // indirect golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 // indirect golang.org/x/text v0.3.2 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect )

    gopathdir/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/quic/quic.go:153:9: c.sess.Close undefined (type quic.Session has no field or method Close) //gopathdir/pkg/mod/github.com/henrylee2cn/erpc/[email protected]/quic/quic.go:156:15: c.sess.Close undefined (type quic.Session has no field or method Close)

    GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o bin/pi/server server.go

  • 使用govendor后的报错

    使用govendor后的报错

    不使用govendor的话正常,但是使用了govendor会有一些的报错,老哥能帮忙看看嘛。。

    vendor/github.com/henrylee2cn/erpc/plugin/auth/auth.go:111:21: cannot use sess (type erpc.PreSession) as type Session in argument to a.bearerFunc: erpc.PreSession does not implement Session (wrong type for Swap method) have Swap() "github.com/henrylee2cn/goutil".Map want Swap() "rock/agent/vendor/github.com/henrylee2cn/goutil".Map

    vendor/github.com/henrylee2cn/erpc/context.go:375:20: cannot use statCodeMtypeNotAllowed (type *"rock/agent/vendor/github.com/henrylee2cn/goutil/status".Status) as type *"github.com/henrylee2cn/goutil/status".Status in argument to c.output.SetStatus

  • go get 报错

    go get 报错

    go get -u -f github.com/henrylee2cn/erpc

    github.com/henrylee2cn/erpc/quic

    github.com\henrylee2cn\erpc\quic\quic.go:27:36: not enough arguments in call to sess.OpenStreamSync have () want (context.Context) github.com\henrylee2cn\erpc\quic\quic.go:96:27: not enough arguments in call to l.lis.Accept have () want (context.Context) github.com\henrylee2cn\erpc\quic\quic.go:100:34: not enough arguments in call to sess.AcceptStream have () want (context.Context)

  • 运行example/Simple失败:qtls.ConnectionState not compatible with tls.ConnectionState

    运行example/Simple失败:qtls.ConnectionState not compatible with tls.ConnectionState

    运行Simple例子失败, Win7 64bits

    panic: qtls.ConnectionState not compatible with tls.ConnectionState

    goroutine 1 [running]: github.com/ourcolour/xnettools/vendor/github.com/lucas-clemente/quic-go/internal/handshake.init.0() E:/goprojects/src/github.com/ourcolour/xnettools/vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go:17 +0x2b3


  • AsyncPull 怎样从PullCmd 中获取session 信息?

    AsyncPull 怎样从PullCmd 中获取session 信息?

    有一组peer,对这组peer 发起一个异步的请求,并使用pingCmdChan 接受所有peer 返回的结果,问题是如何从返回的PullCmd 中获取session (即怎么确认结果是哪个peer 返回的)? (ps: 是不是AsyncPull 不能这么用)

    部分代码如下:

    	pingCmdChan := make(chan tp.PullCmd, batch)
    	for _, peer := range hub.others {
                    ......
    		peer.sess.AsyncPull(
    			"/peer/ping",
    			"ping",
    			new(string),
    			pingCmdChan,
    		)
    	}
            ......
    	for pingCmd := range pingCmdChan {
    		result, rerr := pingCmd.Reply()
                    sess = pingCmd.XXXXX // ?
            }
    
  • invalid PreWriteCallPlugin in router: secure(encrypt/decrypt)

    invalid PreWriteCallPlugin in router: secure(encrypt/decrypt)

    [2021/07/28 15:16:23.140] [DEBU] invalid PreWriteCallPlugin in router: secure(encrypt/decrypt)

    Run with link example,Also I faild -> https://github.com/henrylee2cn/erpc/tree/master/plugin/secure

  • Flat buffers support

    Flat buffers support

    Would you be ok with adding flatbuffers ?

    I used to use protobuf but now flatbuffers is mature. It’s much faster and I am using it on golang projects

    it also makes it much easier to compile to wasm with tinygo if your interested

  • 运行提示 undefined: cpu.HasAES错误

    运行提示 undefined: cpu.HasAES错误

    github.com/marten-seemann/qtls

    src\github.com\marten-seemann\qtls\common.go:1380:20: undefined: cpu.HasAES src\github.com\marten-seemann\qtls\common.go:1380:34: undefined: cpu.ARM64 src\github.com\marten-seemann\qtls\key_schedule.go:40:9: undefined: hkdf.Extract src\github.com\marten-seemann\qtls\key_schedule.go:59:12: undefined: hkdf.Expand src\github.com\marten-seemann\qtls\key_schedule.go:129:30: undefined: curve25519.ScalarSize src\github.com\marten-seemann\qtls\key_schedule.go:133:21: undefined: curve25519.X25519 src\github.com\marten-seemann\qtls\key_schedule.go:133:51: undefined: curve25519.Basepoint src\github.com\marten-seemann\qtls\key_schedule.go:212:20: undefined: curve25519.X25519

A powerful go web framework for highly scalable and resource efficient web application

webfr A powerful go web framework for highly scalable and resource efficient web application Installation: go get -u github.com/krishpranav/webfr Exa

Nov 28, 2021
A powerful go web framework for highly scalable and resource efficient web application

A powerful go web framework for highly scalable and resource efficient web application

Oct 3, 2022
lazy-go is an easy-to-use WEB framework.

lazy-go lazy-go is an easy-to-use WEB framework. Installation Run the following command under your project: go get -u github.com/NICEXAI/lazy-go Quick

Mar 25, 2022
go-zero is a web and rpc framework that with lots of engineering practices builtin.
go-zero is a web and rpc framework that with lots of engineering practices builtin.

go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the stability of the busy services with resilience design, and has been serving sites with tens of millions users for years.

Jan 6, 2023
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero English | 简体中文 0. what is go-zero go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the

Jan 2, 2023
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base

Backend API Example FiberGo Framework Docs : https://github.com/gofiber Info This application using firebase ecosystem Firebase Auth Cloud Storage Fir

May 31, 2022
Simple and easy go web micro framework
Simple and easy go web micro framework

DotWeb Simple and easy go web micro framework Important: Now need go1.9+ version support, and support go mod. Document: https://www.kancloud.cn/devfee

Dec 22, 2022
Easy-to-use web fuzzer, written in Go.

Brutal A lightweight, simple to use web fuzzer. Usage Brutal is pretty easy to use. Command Description --debug print more details about the runtime -

Jul 8, 2022
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Jan 5, 2023
It took me a while to figure out how I can use GraphQL with the ent ORM and serve the GraphQL endpoint via the Echo framework

Go + Graphql + Ent + Echo Boilerplate It took me a while to figure out how I can use GraphQL with the ent ORM and serve the GraphQL endpoint via the E

Sep 28, 2022
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

Nov 14, 2022
The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

Jul 14, 2022
laravel for golang,goal,fullstack framework,api framework
laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

Feb 24, 2022
A quick and easy way to setup a RESTful JSON API

Go-Json-Rest A quick and easy way to setup a RESTful JSON API Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs ea

Jan 3, 2023
Include files in your binary the easy way

New Projects should use the official embed package instead, which was added in go 1.16. binclude binclude is a tool for including static files into Go

Dec 18, 2022
Dec 28, 2022
Flexible E-Commerce Framework on top of Flamingo. Used to build E-Commerce "Portals" and connect it with the help of individual Adapters to other services.

Flamingo Commerce With "Flamingo Commerce" you get your toolkit for building fast and flexible commerce experience applications. A demoshop using the

Dec 31, 2022
A small and evil REST framework for Go

go-rest A small and evil REST framework for Go Reflection, Go structs, and JSON marshalling FTW! go get github.com/ungerik/go-rest import "github.com/

Dec 6, 2022