Documentation ¶
Index ¶
- func CompareArgon2Hash(passphrase, salt string, multiplier uint32, hashedPassword []byte) (bool, error)
- func CompressWithGzip(data []byte, buffer *bytes.Buffer) error
- func CompressWithZstd(data []byte, buffer *bytes.Buffer) error
- func ConvertJSONFileToConfig(fileNamePath string) (*models.RabbitSeasoning, error)
- func ConvertJSONFileToTopologyConfig(fileNamePath string) (*models.TopologyConfig, error)
- func CreateLetter(letterID uint64, exchangeName string, queueName string, body []byte) *models.Letter
- func CreateMockLetter(letterID uint64, exchangeName string, queueName string, body []byte) *models.Letter
- func CreateMockRandomLetter(queueName string) *models.Letter
- func CreatePayload(input interface{}, compression *models.CompressionConfig, ...) ([]byte, error)
- func CreateTLSConfig(pemLocation string, localLocation string) (*tls.Config, error)
- func CreateWrappedPayload(input interface{}, letterID uint64, metadata string, ...) ([]byte, error)
- func DecompressWithGzip(buffer *bytes.Buffer) error
- func DecompressWithZstd(buffer *bytes.Buffer) error
- func DecryptWithAes(cipherDataWithNonce, hashedKey []byte, nonceSize int) ([]byte, error)
- func EncryptWithAes(data, hashedKey []byte, nonceSize int) ([]byte, error)
- func GetHashWithArgon(passphrase, salt string, timeConsideration uint32, multiplier uint32, ...) []byte
- func GetStringHashWithArgon(passphrase, salt string, timeConsideration uint32, threads uint8, ...) string
- func RandomBytes(size int) []byte
- func RandomString(size int) string
- func RandomStringFromSource(size int, src rand.Source) string
- func ReadJSONFileToInterface(fileNamePath string) (interface{}, error)
- func ReadPayload(buffer *bytes.Buffer, compression *models.CompressionConfig, ...) error
- func RepeatedBytes(size int, repeat int) []byte
- func RepeatedRandomString(size int, repeat int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareArgon2Hash ¶
func CompareArgon2Hash(passphrase, salt string, multiplier uint32, hashedPassword []byte) (bool, error)
CompareArgon2Hash creates an Argon hash and then compares it to a provided hash.
func CompressWithGzip ¶
CompressWithGzip uses the standard Gzip Writer to compress data and places data in the supplied buffer.
func CompressWithZstd ¶
CompressWithZstd uses an external dependency for Zstd to compress data and places data in the supplied buffer.
func ConvertJSONFileToConfig ¶
func ConvertJSONFileToConfig(fileNamePath string) (*models.RabbitSeasoning, error)
ConvertJSONFileToConfig opens a file.json and converts to RabbitSeasoning.
func ConvertJSONFileToTopologyConfig ¶
func ConvertJSONFileToTopologyConfig(fileNamePath string) (*models.TopologyConfig, error)
ConvertJSONFileToTopologyConfig opens a file.json and converts to Topology.
func CreateLetter ¶
func CreateLetter(letterID uint64, exchangeName string, queueName string, body []byte) *models.Letter
CreateLetter creates a simple letter for publishing.
func CreateMockLetter ¶
func CreateMockLetter(letterID uint64, exchangeName string, queueName string, body []byte) *models.Letter
CreateMockLetter creates a mock letter for publishing.
func CreateMockRandomLetter ¶
CreateMockRandomLetter creates a mock letter for publishing with random sizes and random Ids.
func CreatePayload ¶
func CreatePayload( input interface{}, compression *models.CompressionConfig, encryption *models.EncryptionConfig) ([]byte, error)
CreatePayload creates a JSON marshal and optionally compresses and encrypts the bytes.
func CreateTLSConfig ¶
CreateTLSConfig creates a x509 TLS Config for use in TLS-based communication.
func CreateWrappedPayload ¶
func CreateWrappedPayload( input interface{}, letterID uint64, metadata string, compression *models.CompressionConfig, encryption *models.EncryptionConfig) ([]byte, error)
CreateWrappedPayload wraps your data in a plaintext wrapper called ModdedLetter and performs the selected modifications to data.
func DecompressWithGzip ¶
DecompressWithGzip uses the standard Gzip Reader to decompress data and places data in the supplied buffer.
func DecompressWithZstd ¶
DecompressWithZstd uses an external dependency for Zstd to decompress data and places data in the supplied buffer.
func DecryptWithAes ¶
DecryptWithAes decrypts bytes based on an Aes compatible hashed key.
func EncryptWithAes ¶
EncryptWithAes encrypts bytes based on an AES-256 compatible hashed key. If nonceSize is less than 12, the standard, 12, is used.
func GetHashWithArgon ¶
func GetHashWithArgon(passphrase, salt string, timeConsideration uint32, multiplier uint32, threads uint8, hashLength uint32) []byte
GetHashWithArgon uses Argon2 version 0x13 to hash a plaintext password with a provided salt string and return hash as bytes.
func GetStringHashWithArgon ¶
func GetStringHashWithArgon(passphrase, salt string, timeConsideration uint32, threads uint8, hashLength uint32) string
GetStringHashWithArgon uses Argon2 version 0x13 to hash a plaintext password with a provided salt string and return hash as base64 string.
func RandomBytes ¶
RandomBytes returns a RandomString converted to bytes.
func RandomString ¶
RandomString creates a new RandomSource to generate a RandomString unique per nanosecond.
func RandomStringFromSource ¶
RandomStringFromSource generates a Random string that should always be unique. Example RandSrc.) var src = rand.NewSource(time.Now().UnixNano()) Source: https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go
func ReadJSONFileToInterface ¶
ReadJSONFileToInterface opens a file.json and converts to interface{}.
func ReadPayload ¶
func ReadPayload(buffer *bytes.Buffer, compression *models.CompressionConfig, encryption *models.EncryptionConfig) error
ReadPayload unencrypts and uncompresses payloads
func RepeatedBytes ¶
RepeatedBytes generates a RandomString and then repeats it up to size.
func RepeatedRandomString ¶
RepeatedRandomString generates a RandomString and then repeats it up to size and repeat count.
Types ¶
This section is empty.