rysrv

package module
v0.0.0-...-1894214 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

server111

Documentation

Overview

Package fastjsonrpc provides fast JSON-RPC 2.0 server for use with fasthttp server.

Index

Constants

This section is empty.

Variables

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) Descriptor() ([]byte, []int)

Deprecated: Use Base.ProtoReflect.Descriptor instead.

func (*Base) GetData

func (x *Base) GetData() []byte

func (*Base) GetErr

func (x *Base) GetErr() string

func (*Base) ProtoMessage

func (*Base) ProtoMessage()

func (*Base) ProtoReflect

func (x *Base) ProtoReflect() protoreflect.Message

func (*Base) Reset

func (x *Base) Reset()

func (*Base) String

func (x *Base) String() string

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{})

Jump to

Keyboard shortcuts

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