go: github.com/pubnub/go/utils Index | Files

package utils

import "github.com/pubnub/go/utils"

Index

Package Files

crypto.go string_utils.go string_utils_1_5.go string_utils_1_7.go

func DecryptString Uses

func DecryptString(cipherKey string, message string) (
    retVal interface{}, err error)

DecryptString decodes encrypted string using the cipherKey

It accepts the following parameters: cipherKey: cipher key to use to decrypt. message: to encrypted.

returns the unencoded encrypted string, error if any.

func EncodeJSONAsPathComponent Uses

func EncodeJSONAsPathComponent(jsonBytes string) string

encodeJSONAsPathComponent properly encodes serialized JSON for placement within a URI path

func EncryptString Uses

func EncryptString(cipherKey string, message string) string

EncryptString creates the base64 encoded encrypted string using the cipherKey. It accepts the following parameters: cipherKey: cipher key to use to encrypt. message: to encrypted.

returns the base64 encoded encrypted string.

func GetHmacSha256 Uses

func GetHmacSha256(secretKey string, input string) string

getHmacSha256 creates the cipher key hashed against SHA256. It accepts the following parameters: secretKey: the secret key. input: input to hash.

returns the hash.

func JoinChannels Uses

func JoinChannels(channels []string) []byte

JoinChannels encodes and joins channels

func PamEncode Uses

func PamEncode(value string) string

func PreparePamParams Uses

func PreparePamParams(params *url.Values) string

func QueryToString Uses

func QueryToString(query *url.Values) string

func Serialize Uses

func Serialize(msg interface{}) ([]byte, error)

func SerializeAndEncrypt Uses

func SerializeAndEncrypt(msg interface{}, cipherKey string, serialize bool) (string, error)

func SerializeEncryptAndSerialize Uses

func SerializeEncryptAndSerialize(msg interface{}, cipherKey string, serialize bool) (string, error)

func URLEncode Uses

func URLEncode(s string) string

TODO: verify the helper is used where supposed to

func UUID Uses

func UUID() string

Generate a random uuid string

func ValueAsString Uses

func ValueAsString(value interface{}) ([]byte, error)

PubNub - specific serializer

type A Uses

type A struct {
    I         string
    Interface *B
}

type B Uses

type B struct {
    Value string
}

Package utils imports 16 packages (graph) and is imported by 1 packages. Updated 2019-10-14. Refresh now. Tools for package owners.