MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / gzipLogData

Function gzipLogData

lib/cronitor.go:381–397  ·  view source on GitHub ↗
(logData string)

Source from the content-addressed store, hash-verified

379}
380
381func gzipLogData(logData string) *bytes.Buffer {
382 var b bytes.Buffer
383 if len(logData) < 1 {
384 return &b
385 }
386
387 gz := gzip.NewWriter(&b)
388 if _, err := gz.Write([]byte(logData)); err != nil {
389 //log("error writing gzip")
390 return nil
391 }
392 if err := gz.Close(); err != nil {
393 //log("error closing gzip")
394 return nil
395 }
396 return &b
397}
398
399func getPresignedUrl(apiKey string, postBody []byte) ([]byte, error) {
400 url := "https://cronitor.io/api/logs/presign"

Callers 1

SendLogDataFunction · 0.85

Calls 2

CloseMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected