package
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Jun 13, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package iohelpers contains functions for file I/O both locally and in GCS.
-
func FilesWithSuffix(ctx context.Context, dir string, suffix string, cfg *IOConfig) ([]string, error)
-
func ReadFile(ctx context.Context, filePath string, cfg *IOConfig) ([]byte, error)
-
func WriteFile(ctx context.Context, filePath, fileName string, content []byte, cfg *IOConfig) error
-
type IOConfig
FilesWithSuffix returns all file paths in a directory that end with a given suffix.
ReadFile reads the contents of a file at the given path.
If the path is a GCS it will attempt to read the file from GCS.
WriteFile writes the given content to a file at the given path.
If the path is a GCS it will attempt to write the file to GCS.
type IOConfig struct {
GCSEndpoint string
}
IOConfig contains configuration options for IO functions.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.