Documentation ¶
Overview ¶
Package read contains all of the logic necessary to verify the availability and consistency of the file contents and names in GCS.
Index ¶
Constants ¶
View Source
const (
// universal format of the names of files in the storage system Hermes_ID_checksum
FileNameFormat = "Hermes_%02d_%x"
)
Variables ¶
This section is empty.
Functions ¶
func ReadFile ¶
func ReadFile(ctx context.Context, target *target.Target, fileID int32, fileSize int, client stiface.Client, logger *logger.Logger) error
ReadFile creates and stores a file with randomized contents in the target storage system. Before it creates and stores a file it logs an intent to do so in the target storage system's journal. It verifies that the creation and storage process was successful. Finally, it updates the filenames map in the target's journal and record the exit status in the logger. Arguments:
ctx: it carries deadlines and cancellation signals that might orinate from the main probe located in probe.go. target: contains information about target storage system, carries an intent log in the form of a StateJournal and it used to export metrics. fileID: the unique identifer of every file, it cannot be repeated. It needs to be in the range [minFileID, maxFileID]. FileID 0 is reserved for a special file called the NIL file. client: is a storage client. It is used as an interface to interact with the target storage system. logger: a cloudprober logger used to record the exit status of the ReadFile operation in a target bucket. The logger passed MUST be a valid logger.
Returns:
error: an error string with detailed information about the status and fileID. Nil is returned when the operation is successful.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.