protocol_impl

package
v0.0.0-...-278a4e6 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSchema = "http"
View Source
const IOCProtocolName = "ioc"

Variables

View Source
var ServiceMap = &serviceMap{
	serviceMap:   make(map[string]map[string]*Service),
	interfaceMap: make(map[string][]*Service),
}

ServiceMap store description of service.

Functions

func ParseArgs

func ParseArgs(argsType []reflect.Type, data []byte) ([]interface{}, error)

ParseArgs @data should be []interface{}'s marshal result, @argsType should be each object's reflect type

Types

type IOCProtocol

type IOCProtocol struct {
	// contains filtered or unexported fields
}

IOCProtocol is ioc protocol impl

func GetIOCProtocol

func GetIOCProtocol(p *Param) (*IOCProtocol, error)

func (*IOCProtocol) Export

func (*IOCProtocol) Invoke

type IOCProtocolIOCInterface

type IOCProtocolIOCInterface interface {
	Invoke(invocation protocol.Invocation) protocol.Result
	Export(invoker protocol.Invoker) protocol.Exporter
}

func GetIOCProtocolIOCInterface

func GetIOCProtocolIOCInterface(p *Param) (IOCProtocolIOCInterface, error)

type MethodType

type MethodType struct {
	// contains filtered or unexported fields
}

MethodType is description of service method.

func (*MethodType) ArgsType

func (m *MethodType) ArgsType() []reflect.Type

ArgsType gets @m.argsType.

func (*MethodType) CtxType

func (m *MethodType) CtxType() reflect.Type

CtxType gets @m.ctxType.

func (*MethodType) Method

func (m *MethodType) Method() reflect.Method

Method gets @m.method.

func (*MethodType) ReplyType

func (m *MethodType) ReplyType() reflect.Type

ReplyType gets @m.replyType.

func (*MethodType) SuiteContext

func (m *MethodType) SuiteContext(ctx context.Context) reflect.Value

SuiteContext transfers @ctx to reflect.Value type or get it from @m.ctxType.

type Param

type Param struct {
	Address    string
	Timeout    string
	ExportPort string
}

func (*Param) Init

func (p *Param) Init(iocProtocol *IOCProtocol) (*IOCProtocol, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is description of service

func (*Service) Method

func (s *Service) Method() map[string]*MethodType

Method gets @s.methods.

func (*Service) Name

func (s *Service) Name() string

Name will return service name

func (*Service) Rcvr

func (s *Service) Rcvr() reflect.Value

Rcvr gets @s.rcvr.

func (*Service) RcvrType

func (s *Service) RcvrType() reflect.Type

RcvrType gets @s.rcvrType.

Jump to

Keyboard shortcuts

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