예제 #1
0
파일: server.go 프로젝트: rinor/cgrates
func (s *Server) BiRPCRegister(rcvr interface{}) {
	if s.birpcSrv == nil {
		s.birpcSrv = rpc2.NewServer()
	}
	rcvType := reflect.TypeOf(rcvr)
	for i := 0; i < rcvType.NumMethod(); i++ {
		method := rcvType.Method(i)
		if method.Name != "Call" {
			s.birpcSrv.Handle("SMGenericV1."+method.Name, method.Func.Interface())
		}
	}
}
예제 #2
0
파일: server.go 프로젝트: rinor/cgrates
// Registers a new BiJsonRpc name
func (s *Server) BiRPCRegisterName(method string, handlerFunc interface{}) {
	if s.birpcSrv == nil {
		s.birpcSrv = rpc2.NewServer()
	}
	s.birpcSrv.Handle(method, handlerFunc)
}