utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(logStringToSend *string) []byte

Compress compresses string and returns byte array

func CompressBuffer

func CompressBuffer(inputbuf *bytes.Buffer) *bytes.Buffer

CompressBuffer compresses string and returns byte array

func ParseJson added in v1.0.3

func ParseJson(s string) (js map[string]interface{}, err error)

ParseJson to determine whether a string is valid JSON

func PrettyPrint

func PrettyPrint(v interface{}) string

PrettyPrint is to print the object

func Retry

func Retry(fn Func, maxRetries int) error

Retry keeps trying the function until the second argument returns false, or no error is returned.

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice checks string present in slice of strings

func UploadToS3

func UploadToS3(bucketName *string, keyName *string, data io.Reader) error

UploadToS3 send data to S3

Types

type Func

type Func func(attempt int) (retry bool, err error)

Func represents functions that can be retried.

Jump to

Keyboard shortcuts

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