delete

package
v0.0.0-...-6fa6ba7 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package delete implements the file deletion operation with a storage system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(ctx context.Context, fileID int32, target *target.Target, client stiface.Client, logger *logger.Logger) (int32, error)

DeleteFile deletes the file, corresponding to the ID passed, in the target storage system bucket. It then checks that the file has been deleted by trying to get the object. Arguments:

  • ctx: context allows this probe can be cancelled if needed.

- fileID: ID of the file to be deleted. Must be within inclusive range: 11-50.

  • config: HermesProbeDef config for the probe calling this function.
  • target: target run information stored in struct from probe/probe.go
  • client: initialised storage client for this target system.
  • logger: logger associated with the probe calling this function.

Returns:

  • fileID: returns the ID of the deleted file.
  • err: Status:
  • StateJournalInconsistent: the file to be deleted does not exist in Hermes' StateJournal.
  • FileMissing: the file to be deleted could not be found in the target bucket.
  • BucketMissing: the target bucket on this target system was not found.
  • ProbeFailed: there was an error during one of the API calls and the probe failed.

func PickFileToDelete

func PickFileToDelete() int32

PickFileToDelete picks which file to delete and returns the integer ID of this file. Returns:

  • ID: returns the ID of the file to be deleted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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