storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/cmd/format-meta.go (about)

     1  /*
     2   * MinIO Cloud Storage, (C) 2017 MinIO, Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package cmd
    18  
    19  // Format related consts
    20  const (
    21  	// Format config file carries backend format specific details.
    22  	formatConfigFile = "format.json"
    23  )
    24  
    25  const (
    26  	// Version of the formatMetaV1
    27  	formatMetaVersionV1 = "1"
    28  )
    29  
    30  // format.json currently has the format:
    31  // {
    32  //   "version": "1",
    33  //   "format": "XXXXX",
    34  //   "XXXXX": {
    35  //
    36  //   }
    37  // }
    38  // Here "XXXXX" depends on the backend, currently we have "fs" and "xl" implementations.
    39  // formatMetaV1 should be inherited by backend format structs. Please look at format-fs.go
    40  // and format-xl.go for details.
    41  
    42  // Ideally we will never have a situation where we will have to change the
    43  // fields of this struct and deal with related migration.
    44  type formatMetaV1 struct {
    45  	// Version of the format config.
    46  	Version string `json:"version"`
    47  	// Format indicates the backend format type, supports two values 'xl' and 'fs'.
    48  	Format string `json:"format"`
    49  	// ID is the identifier for the minio deployment
    50  	ID string `json:"id"`
    51  }