util

package
v0.0.0-...-b73c172 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key, data []byte) ([]byte, error)

Decrypt decrypts the data

func Encrypt

func Encrypt(key, data []byte) ([]byte, error)

Encrypt encrypts the data

func FindMax

func FindMax(array []int) int

Find max value in list

func FindNextVNode

func FindNextVNode(ringStruct []int, virtualNodeMap map[int]string, virtualNodeLocation []int, hashedValue uint32) string

func GetHash

func GetHash(s string) (uint32, error)

func GetIndex

func GetIndex(slice []int, value int) int

Get index from input int slice

func IntInSlice

func IntInSlice(s []int, v int) bool

IntInSlice check if a given integer v is in the slice of integers s

func MapHashToVNode

func MapHashToVNode(virtualNodeMap map[int]string, virtualNodeLocation []int, hashedValue uint32) string

func MapHashToVNodeLoc

func MapHashToVNodeLoc(virtualNodeMap map[int]string, virtualNodeLocation []int, hashedValue uint32) int

func NodePidFromVNode

func NodePidFromVNode(virtualNodeName string) int

func SetField

func SetField(obj interface{}, name string, value interface{}) error

func SliceRemoveInt

func SliceRemoveInt(s []int, v int) ([]int, error)

SliceRemoveInt removes an integer value from a slice of integer, if value does not exist, it will throw an error

func StringHashToUint

func StringHashToUint(hashedValue string) uint32

func Zip

func Zip(lists ...[]int) func() []int

Zip slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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