...

Source file src/go.etcd.io/etcd/server/v3/datadir/datadir.go

Documentation: go.etcd.io/etcd/server/v3/datadir

     1  // Copyright 2021 The etcd Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package datadir
    16  
    17  import "path/filepath"
    18  
    19  const (
    20  	memberDirSegment   = "member"
    21  	snapDirSegment     = "snap"
    22  	walDirSegment      = "wal"
    23  	backendFileSegment = "db"
    24  )
    25  
    26  func ToBackendFileName(dataDir string) string {
    27  	return filepath.Join(ToSnapDir(dataDir), backendFileSegment)
    28  }
    29  
    30  func ToSnapDir(dataDir string) string {
    31  	return filepath.Join(ToMemberDir(dataDir), snapDirSegment)
    32  }
    33  
    34  func ToWalDir(dataDir string) string {
    35  	return filepath.Join(ToMemberDir(dataDir), walDirSegment)
    36  }
    37  
    38  func ToMemberDir(dataDir string) string {
    39  	return filepath.Join(dataDir, memberDirSegment)
    40  }
    41  

View as plain text