mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 23:58:17 +01:00
Added transcoders for interleaved LevelDB backend.
This commit is contained in:
parent
712708f87c
commit
954cc1928b
@ -161,6 +161,22 @@ func IdentityTranscoder(key []byte) ([]byte, error) {
|
|||||||
return key, nil
|
return key, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TranscodePlainToInterleaved(key []byte) ([]byte, error) {
|
||||||
|
if pos, err := DecodeStringFromBytesToInterleaved(key); err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
return EncodeToBigEndian(pos)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TranscodeInterleavedToPlain(key []byte) ([]byte, error) {
|
||||||
|
if pos, err := DecodeFromBigEndian(key); err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
return EncodeStringToBytes(TransformInterleavedToPlain(pos))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func SelectKeySplitter(interleaved bool) KeySplitter {
|
func SelectKeySplitter(interleaved bool) KeySplitter {
|
||||||
if interleaved {
|
if interleaved {
|
||||||
return InterleavedToCoord
|
return InterleavedToCoord
|
||||||
|
Loading…
Reference in New Issue
Block a user