rest

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 19 Imported by: 21

Documentation

Overview

Package rest implements restful rpc protocol.

Index

Constants

View Source
const REST = "rest"

Variables

This section is empty.

Functions

func GetRestProtocol

func GetRestProtocol() base.Protocol

GetRestProtocol get a rest protocol

Types

type RestExporter

type RestExporter struct {
	base.BaseExporter
}

RestExporter is the exporter implementation for REST protocol.

func NewRestExporter

func NewRestExporter(key string, invoker base.Invoker, exporterMap *sync.Map) *RestExporter

NewRestExporter returns a RestExporter

func (*RestExporter) UnExport added in v3.0.4

func (re *RestExporter) UnExport()

UnExport unexport the RestExporter

type RestInvoker

type RestInvoker struct {
	base.BaseInvoker
	// contains filtered or unexported fields
}

RestInvoker invokes REST services using a RestClient and method mappings.

func NewRestInvoker

func NewRestInvoker(url *common.URL, client *client.RestClient, restMethodConfig map[string]*config.RestMethodConfig) *RestInvoker

NewRestInvoker returns a RestInvoker

func (*RestInvoker) Invoke

func (ri *RestInvoker) Invoke(ctx context.Context, inv base.Invocation) result.Result

Invoke is used to call service method by invocation

type RestProtocol

type RestProtocol struct {
	base.BaseProtocol
	// contains filtered or unexported fields
}

RestProtocol implements base.Protocol for REST.

func NewRestProtocol

func NewRestProtocol() *RestProtocol

NewRestProtocol returns a RestProtocol

func (*RestProtocol) Destroy

func (rp *RestProtocol) Destroy()

Destroy destroy rest service

func (*RestProtocol) Export

func (rp *RestProtocol) Export(invoker base.Invoker) base.Exporter

Export export rest service

func (*RestProtocol) Refer

func (rp *RestProtocol) Refer(url *common.URL) base.Invoker

Refer create rest service reference

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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