utils

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: Apache-2.0, BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBytes

func CopyBytes(source []byte, size ...int) []byte

CopyBytes returns a copy of the source slice. If size is not passed, the result slice has same size as the source slice.

func CreateDirectory

func CreateDirectory(dir string, perm os.FileMode) error

CreateDirectory checks if the directory exists, otherwise it creates it with given permissions.

func KeyPrefixUpperBound

func KeyPrefixUpperBound(start []byte) []byte

KeyPrefixUpperBound returns the upper bound (not included in the prefix set) for a prefix range scan.

func PathExists

func PathExists(path string) (bool, error)

PathExists returns whether the given file or directory exists.

func SortSlice

func SortSlice(slice []string, iterDirection ...kvstore.IterDirection) []string

SortSlice sorts a slice according to the given IterDirection.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL