FuncServiceImpl

package
v0.0.0-...-63b2ac5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RpcFuncRespCode_Success = iota
	RpcFuncRespCode_nilRequest
)
View Source
const (
	RpcFuncRespHead_MsgCode = "MsgCode"
	RpcFuncRespHead_Message = "Message"
)

Variables

This section is empty.

Functions

func FuncResponse_Args

func FuncResponse_Args(req *services.RpcFuncRequest, head FuncHeader) (resp *services.RpcFuncResponse)

func FuncResponse_MsgCode

func FuncResponse_MsgCode(req *services.RpcFuncRequest, codemsg RespHead_CodeMsg, errmsg ...string) (resp *services.RpcFuncResponse)

Types

type Caller

type Caller func(head FuncHeader, reqbody []byte) (respHead FuncHeader, respBody []byte, err error)

type FuncHeader

type FuncHeader map[string]*services.RpcFuncHeader

func MakeHead

func MakeHead() FuncHeader

func NewFuncHead

func NewFuncHead(code, msg string) FuncHeader

func NewFuncHead2

func NewFuncHead2(codemsg RespHead_CodeMsg, errmsg ...string) FuncHeader

func (FuncHeader) Put

func (this FuncHeader) Put(k, v string) FuncHeader

func (FuncHeader) PutHeader

func (this FuncHeader) PutHeader(header *services.RpcFuncHeader) FuncHeader

type FuncService

type FuncService interface {
	GetServiceId() uint32
	GetServiceCode() string
	SupportVersion(version uint32) bool
	GetCaller(funcId uint32) Caller
}

type FuncServiceServerConfig

type FuncServiceServerConfig struct {
	Fcservice FuncService
	// contains filtered or unexported fields
}

type RespHead_CodeMsg

type RespHead_CodeMsg [2]string
var (
	RespHead_Success          RespHead_CodeMsg = [2]string{"0", "successful"}
	RespHead_Error            RespHead_CodeMsg = [2]string{"1", "No Parsed Error"}
	RespHead_Invalid          RespHead_CodeMsg = [2]string{"2", "invalid parameter"}
	RespHead_Invalid_Ack      RespHead_CodeMsg = [2]string{"3", " ack is invaild status,it right value has not be zero."}
	RespHead_CodeNotMatch     RespHead_CodeMsg = [2]string{"4", "service code is not match this service."}
	RespHead_noSupportVersion RespHead_CodeMsg = [2]string{"5", "this service not support that version"}
	RespHead_noSupportFuncId  RespHead_CodeMsg = [2]string{"6", "this service not support that funcId"}
	RespHead_funcError        RespHead_CodeMsg = [2]string{"7", "module-func call has been error."}
)

type SimpleFuncServiceServerImpl

type SimpleFuncServiceServerImpl struct {
	Fsconfig *FuncServiceServerConfig
}

func (*SimpleFuncServiceServerImpl) Ack

func (this *SimpleFuncServiceServerImpl) Ack(ctx context.Context, ack *services.Ack) (*services.Ack, error)

func (*SimpleFuncServiceServerImpl) FuncInvoker

func (this *SimpleFuncServiceServerImpl) FuncInvoker(ctx context.Context, funcRequest *services.RpcFuncRequest) (resp *services.RpcFuncResponse, err error)

func (*SimpleFuncServiceServerImpl) GetServiceFunList

func (*SimpleFuncServiceServerImpl) GetServiceFunList(ctx context.Context, servicePoint *services.ServicePointInfo) (funcList *services.ServiceFunList, err error)

func (*SimpleFuncServiceServerImpl) GetServiceStatus

func (*SimpleFuncServiceServerImpl) GetServiceStatus(ctx context.Context, servicePoint *services.ServicePointInfo) (status *services.ServiceStatus, err error)

Jump to

Keyboard shortcuts

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