helpers

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique(list []string, element string) []string

func BytesArrToStringArr

func BytesArrToStringArr(val []byte) ([]string, error)

func BytesFromBase64

func BytesFromBase64(str string) []byte

BytesFromBase64 decodes a byte array from a base64 string.

func BytesFromHex

func BytesFromHex(str string) []byte

BytesFromHex decodes a byte array from a hex string.

func BytesToBase64

func BytesToBase64(bytes []byte) string

BytesToBase64 encodes a byte array as a base64 string.

func BytesToHex

func BytesToHex(bytes []byte) string

BytesToHex encodes a byte array as a hex string.

func BytesToString

func BytesToString(val []byte) string

func GetCid

func GetCid(content []byte) (string, error)

GetCid gets the content ID.

func Int64ToBytes

func Int64ToBytes(num int64) []byte

func MarshalMapToJSONBytes

func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte)

MarshalMapToJSONBytes converts map[string]interface{} to bytes.

func SetToSlice

func SetToSlice(set set.Set) []string

func SliceToSet

func SliceToSet(names []string) set.Set

func StrArrToBytesArr

func StrArrToBytesArr(val []string) ([]byte, error)

func StringToBytes

func StringToBytes(val string) []byte

func UnMarshalMapFromJSONBytes

func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{}

UnMarshalMapFromJSONBytes converts bytes to map[string]interface{}.

Types

This section is empty.

Jump to

Keyboard shortcuts

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