Documentation ¶
Index ¶
- func KeyRangeContains(kr *topodatapb.KeyRange, id []byte) bool
- func KeyRangeEndEqual(left, right *topodatapb.KeyRange) bool
- func KeyRangeEqual(left, right *topodatapb.KeyRange) bool
- func KeyRangeIsPartial(kr *topodatapb.KeyRange) bool
- func KeyRangeStartEqual(left, right *topodatapb.KeyRange) bool
- func KeyRangeString(k *topodatapb.KeyRange) string
- func KeyRangesIntersect(first, second *topodatapb.KeyRange) bool
- func KeyRangesOverlap(first, second *topodatapb.KeyRange) (*topodatapb.KeyRange, error)
- func ParseKeyRangeParts(start, end string) (*topodatapb.KeyRange, error)
- func ParseKeyspaceIDType(param string) (topodatapb.KeyspaceIdType, error)
- func ParseShardingSpec(spec string) ([]*topodatapb.KeyRange, error)
- type Uint64Key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyRangeContains ¶
func KeyRangeContains(kr *topodatapb.KeyRange, id []byte) bool
KeyRangeContains returns true if the provided id is in the keyrange.
func KeyRangeEndEqual ¶
func KeyRangeEndEqual(left, right *topodatapb.KeyRange) bool
KeyRangeEndEqual returns true if both key ranges have the same end
func KeyRangeEqual ¶
func KeyRangeEqual(left, right *topodatapb.KeyRange) bool
KeyRangeEqual returns true if both key ranges cover the same area
func KeyRangeIsPartial ¶
func KeyRangeIsPartial(kr *topodatapb.KeyRange) bool
KeyRangeIsPartial returns true if the KeyRange does not cover the entire space.
func KeyRangeStartEqual ¶
func KeyRangeStartEqual(left, right *topodatapb.KeyRange) bool
KeyRangeStartEqual returns true if both key ranges have the same start
func KeyRangeString ¶
func KeyRangeString(k *topodatapb.KeyRange) string
KeyRangeString prints a topodatapb.KeyRange
func KeyRangesIntersect ¶
func KeyRangesIntersect(first, second *topodatapb.KeyRange) bool
KeyRangesIntersect returns true if some Keyspace values exist in both ranges.
func KeyRangesOverlap ¶
func KeyRangesOverlap(first, second *topodatapb.KeyRange) (*topodatapb.KeyRange, error)
KeyRangesOverlap returns the overlap between two KeyRanges. They need to overlap, otherwise an error is returned.
func ParseKeyRangeParts ¶
func ParseKeyRangeParts(start, end string) (*topodatapb.KeyRange, error)
ParseKeyRangeParts parses a start and end hex values and build a proto KeyRange
func ParseKeyspaceIDType ¶
func ParseKeyspaceIDType(param string) (topodatapb.KeyspaceIdType, error)
ParseKeyspaceIDType parses the keyspace id type into the enum
func ParseShardingSpec ¶
func ParseShardingSpec(spec string) ([]*topodatapb.KeyRange, error)
ParseShardingSpec parses a string that describes a sharding specification. a-b-c-d will be parsed as a-b, b-c, c-d. The empty string may serve both as the start and end of the keyspace: -a-b- will be parsed as start-a, a-b, b-end.