mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 17:53:43 +01:00
Separate the codebase for XL and FS format.json related code (#5317)
This commit is contained in:
committed by
kannappanr
parent
ccd9767b7a
commit
7c72d14027
52
cmd/format-meta.go
Normal file
52
cmd/format-meta.go
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Minio Cloud Storage, (C) 2017 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cmd
|
||||
|
||||
// Format related consts
|
||||
const (
|
||||
// Format config file carries backend format specific details.
|
||||
formatConfigFile = "format.json"
|
||||
|
||||
// Format config tmp file carries backend format.
|
||||
formatConfigFileTmp = "format.json.tmp"
|
||||
)
|
||||
|
||||
const (
|
||||
// Version of the formatMetaV1
|
||||
formatMetaVersionV1 = "1"
|
||||
)
|
||||
|
||||
// format.json currently has the format:
|
||||
// {
|
||||
// "version": "1",
|
||||
// "format": "XXXXX",
|
||||
// "XXXXX": {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// Here "XXXXX" depends on the backend, currently we have "fs" and "xl" implementations.
|
||||
// formatMetaV1 should be inherited by backend format structs. Please look at format-fs.go
|
||||
// and format-xl.go for details.
|
||||
|
||||
// Ideally we will never have a situation where we will have to change the
|
||||
// fields of this struct and deal with related migration.
|
||||
type formatMetaV1 struct {
|
||||
// Version of the format config.
|
||||
Version string `json:"version"`
|
||||
// Format indicates the backend format type, supports two values 'xl' and 'fs'.
|
||||
Format string `json:"format"`
|
||||
}
|
||||
Reference in New Issue
Block a user