rysrv

package module
v0.0.0-...-9942a6b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 10 Imported by: 0

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