Documentation ¶
Index ¶
Constants ¶
const ( TempFileStrLine = "This is a test file" TmpDirectory = "/tmp" )
Variables ¶
This section is empty.
Functions ¶
func CreateLocalTempFile ¶
Creates a temporary file (name-collision-safe) in /tmp with given content size in bytes. If gzipCompress is true, output file is a gzip-compressed file. contentSize is the size of the uncompressed content. In case gzipCompress is true, the actual output file size will be different from contentSize (typically gzip-compressed file size < contentSize). Caller is responsible for deleting the created file when done using it. Failure cases: 1. contentSize <= 0 2. os.CreateTemp() returned error or nil handle 3. gzip.NewWriter() returned nil handle 4. Failed to write the content to the created temp file
func DownloadGzipGcsObjectAsCompressed ¶
Downloads given gzipped GCS object (with path without 'gs://') to local disk. Fails if the object doesn't exist or permission to read object is not available. Uses go storage client library to download object. Use of gsutil/gcloud is not possible as they both always read back objects with content-encoding: gzip as uncompressed/decompressed irrespective of any argument passed.
Types ¶
This section is empty.