本文整理汇总了Golang中github.com/youtube/vitess/go/vt/key.KeyRange.End方法的典型用法代码示例。如果您正苦于以下问题:Golang KeyRange.End方法的具体用法?Golang KeyRange.End怎么用?Golang KeyRange.End使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/youtube/vitess/go/vt/key.KeyRange
的用法示例。
在下文中一共展示了KeyRange.End方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: buildBindVarCondition
//.........这里部分代码省略.........
}
v, ok = bvcinfo["Operator"]
if !ok {
err = NewTabletError(FAIL, "Operator missing in BindVarConds")
return
}
strop, ok := v.(string)
if !ok {
err = NewTabletError(FAIL, "Expecting string for Operator")
return
}
op, ok = opmap[strop]
if !ok {
err = NewTabletError(FAIL, "Invalid Operator %s", strop)
return
}
if op == QR_NOOP {
return
}
v, ok = bvcinfo["Value"]
if !ok {
err = NewTabletError(FAIL, "Value missing in BindVarConds")
return
}
if op >= QR_EQ && op <= QR_LE {
strvalue, ok := v.(string)
if !ok {
err = NewTabletError(FAIL, "Expecting string: %v", v)
return
}
if strop[0] == 'U' {
value, err = strconv.ParseUint(strvalue, 0, 64)
if err != nil {
err = NewTabletError(FAIL, "Expecting uint64: %s", strvalue)
return
}
} else if strop[0] == 'I' {
value, err = strconv.ParseInt(strvalue, 0, 64)
if err != nil {
err = NewTabletError(FAIL, "Expecting int64: %s", strvalue)
return
}
} else if strop[0] == 'S' {
value = strvalue
} else {
panic("unexpected")
}
} else if op == QR_MATCH || op == QR_NOMATCH {
strvalue, ok := v.(string)
if !ok {
err = NewTabletError(FAIL, "Expecting string: %v", v)
return
}
value = strvalue
} else if op == QR_IN || op == QR_NOTIN {
kr, ok := v.(map[string]interface{})
if !ok {
err = NewTabletError(FAIL, "Expecting keyrange for Value")
return
}
var keyrange key.KeyRange
strstart, ok := kr["Start"]
if !ok {
err = NewTabletError(FAIL, "Start missing in KeyRange")
return
}
start, ok := strstart.(string)
if !ok {
err = NewTabletError(FAIL, "Expecting string for Start")
return
}
keyrange.Start = key.KeyspaceId(start)
strend, ok := kr["End"]
if !ok {
err = NewTabletError(FAIL, "End missing in KeyRange")
return
}
end, ok := strend.(string)
if !ok {
err = NewTabletError(FAIL, "Expecting string for End")
return
}
keyrange.End = key.KeyspaceId(end)
value = keyrange
}
v, ok = bvcinfo["OnMismatch"]
if !ok {
err = NewTabletError(FAIL, "OnMismatch missing in BindVarConds")
return
}
onMismatch, ok = v.(bool)
if !ok {
err = NewTabletError(FAIL, "Expecting bool for OnAbsent")
return
}
return
}