Documentation ¶
Overview ¶
Package fastjsonrpc provides fast JSON-RPC 2.0 server for use with fasthttp server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_base_proto protoreflect.FileDescriptor
Functions ¶
func SetError ¶
func SetError(fctx *fasthttp.RequestCtx, err error)
func SetResult ¶
func SetResult(fctx *fasthttp.RequestCtx, result interface{})
func Unmarshal ¶
func Unmarshal(ctx *fasthttp.RequestCtx, v interface{}) error
Types ¶
type Base ¶
type Base struct { Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Base) Descriptor
deprecated
func (*Base) ProtoMessage ¶
func (*Base) ProtoMessage()
func (*Base) ProtoReflect ¶
func (x *Base) ProtoReflect() protoreflect.Message
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is a JSON-RPC 2.0 methods repository.
func NewRepository ¶
func NewRepository() *Repository
NewRepository returns empty repository.
It's safe to use Repository default value.
func (*Repository) Register ¶
func (r *Repository) Register(method string, handler func(ctx *fasthttp.RequestCtx))
Register registers new method handler.
func (*Repository) RequestHandler ¶
func (r *Repository) RequestHandler() fasthttp.RequestHandler
RequestHandler is suitable for using with fasthttp.
func (*Repository) Use ¶
func (r *Repository) Use(name string, obj interface{})
Click to show internal directories.
Click to hide internal directories.