|
|
- // Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.
-
- package container
-
- import (
- "errors"
- "fmt"
- )
-
- // 服务方法句柄
- type ServiceMethodHandler struct {
- // 调用器
- caller Caller
- }
-
- // 创建服务方法句柄
- // 参数
- // 1.调用器
- // 返回值:
- // 1.服务方法句柄
- // 2.错误
- func NewServiceMethodHandler(caller Caller) (*ServiceMethodHandler, error) {
- if caller == nil {
- return nil, errors.New(fmt.Sprintf("调用器不能为空!"))
- }
- return &ServiceMethodHandler{caller}, nil
- }
-
- // 获取调用器
- // 返回值:
- // 1.调用器
- func (broker *ServiceMethodHandler) Caller() Caller {
- return broker.caller
- }
|