github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ios/label.go (about)

     1  // Package ios is a collection of interfaces to the local storage subsystem;
     2  // the package includes OS-dependent implementations for those interfaces.
     3  /*
     4   * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
     5   */
     6  package ios
     7  
     8  // Introduced in v3.23, mountpath labels are used to deliver extended (mountpath usage related)
     9  // functionality that includes:
    10  //   - mapping of the mountpath to its underlying disk(s), if any
    11  //     (potentially useful in highly virtualized/containerized environments);
    12  //   - disk sharing between multiple mountpaths;
    13  //   - storage classes (as in: "different storages - for different buckets");
    14  //   - user-defined grouping of the mountpaths
    15  //     (e.g., to reflect different non-overlapping storage capacities and/or storage classes)
    16  //
    17  // In v3.23, user-assigned `ios.Label` simply implies that user takes a full responsibility
    18  // for filesystem sharing (or not sharing) across mountpaths
    19  type Label string
    20  
    21  const TestLabel = Label("test-label")
    22  
    23  func (label Label) IsNil() bool { return label == "" }
    24  
    25  func (label Label) ToLog() string {
    26  	if label == "" {
    27  		return ""
    28  	}
    29  	return ", \"" + string(label) + "\""
    30  }