utils

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesEquals added in v1.2.7

func BytesEquals(a []byte, b []byte) bool

BytesEquals check whether the given bytes is equal

func ConvertRange added in v1.2.8

func ConvertRange(start int64, end int64, size int64) (int, int)

ConvertRange converts redis index to go slice index -1 => size-1 both inclusive [0, 10] => left inclusive right exclusive [0, 9) out of bound to max inbound [size, size+1] => [-1, -1]

func Equals added in v1.2.7

func Equals(a interface{}, b interface{}) bool

Equals check whether the given value is equal

func RandHexString added in v1.2.9

func RandHexString(n int) string

func RandString

func RandString(n int) string

RandString create a random string no longer than n

func ToCmdLine added in v1.2.7

func ToCmdLine(cmd ...string) [][]byte

ToCmdLine convert strings to [][]byte

func ToCmdLine2 added in v1.2.7

func ToCmdLine2(commandName string, args ...string) [][]byte

ToCmdLine2 convert commandName and string-type argument to [][]byte

func ToCmdLine3 added in v1.2.8

func ToCmdLine3(commandName string, args ...[]byte) [][]byte

ToCmdLine3 convert commandName and []byte-type argument to CmdLine

Types

This section is empty.

Jump to

Keyboard shortcuts

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