Documentation ¶
Index ¶
- func CreateDirIfMissing(dirPath string) (bool, error)
- func DecodeOrderPreservingVarUint64(bytes []byte) (uint64, int)
- func DirEmpty(dirPath string) (bool, error)
- func EncodeOrderPreservingVarUint64(number uint64) []byte
- func FileExists(filePath string) (bool, int64, error)
- func ListSubdirs(dirPath string) ([]string, error)
- type Buffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfMissing ¶
CreateDirIfMissing creates a dir for dirPath if not already exists. If the dir is empty it returns true
func DecodeOrderPreservingVarUint64 ¶
DecodeOrderPreservingVarUint64 decodes the number from the bytes obtained from method 'EncodeOrderPreservingVarUint64'. Also, returns the number of bytes that are consumed in the process
func EncodeOrderPreservingVarUint64 ¶
EncodeOrderPreservingVarUint64 returns a byte-representation for a uint64 number such that all zero-bits starting bytes are trimmed in order to reduce the length of the array For preserving the order in a default bytes-comparison, first byte contains the number of remaining bytes. The presence of first byte also allows to use the returned bytes as part of other larger byte array such as a composite-key representation in db
func FileExists ¶
FileExists checks whether the given file exists. If the file exists, this method also returns the size of the file.
func ListSubdirs ¶
ListSubdirs returns the subdirectories
Types ¶
type Buffer ¶ added in v1.0.0
type Buffer struct {
// contains filtered or unexported fields
}
Buffer provides a wrapper on top of proto.Buffer. The purpose of this wrapper is to get to know the current position in the []byte
func (*Buffer) DecodeRawBytes ¶ added in v1.0.0
DecodeRawBytes wraps the actual method and updates the position
func (*Buffer) DecodeVarint ¶ added in v1.0.0
DecodeVarint wraps the actual method and updates the position
func (*Buffer) GetBytesConsumed ¶ added in v1.0.0
GetBytesConsumed returns the offset of the current position in the underlying []byte