func resultRouter()

in gdbclient/internal/graphsonv3/graphreader.go [149:164]


func resultRouter(raw json.RawMessage) (interface{}, error) {
	var j result
	if err := json.Unmarshal(raw, &j); err == nil {
		if router, ok := resultRouterMap[j.Type]; ok {
			return router(&j)
		} else {
			internal.Logger.Error("graphSonV3 unknown type", zap.String("type", j.Type), zap.String("raw", string(raw)))
			return nil, errors.New("un-support type :" + j.Type)
		}
	} else {
		return getBoolOrString(raw)
	}

	internal.Logger.Error("graphSonV3 un-handle response", zap.String("raw", string(raw)))
	return nil, internal.NewDeserializerError("single result", raw, nil)
}