forked from TrueCloudLab/restic
cache: unexport internal functions
This commit is contained in:
parent
819b6da762
commit
0a65901e18
1 changed files with 7 additions and 7 deletions
14
cache.go
14
cache.go
|
@ -99,7 +99,7 @@ func (c *Cache) purge(t backend.Type, subtype string, id backend.ID) error {
|
|||
}
|
||||
|
||||
func (c *Cache) Clear(s *server.Server) error {
|
||||
list, err := c.List(backend.Snapshot)
|
||||
list, err := c.list(backend.Snapshot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -120,19 +120,19 @@ func (c *Cache) Clear(s *server.Server) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
type CacheEntry struct {
|
||||
type cacheEntry struct {
|
||||
ID backend.ID
|
||||
Subtype string
|
||||
}
|
||||
|
||||
func (c CacheEntry) String() string {
|
||||
func (c cacheEntry) String() string {
|
||||
if c.Subtype != "" {
|
||||
return c.ID.Str() + "." + c.Subtype
|
||||
}
|
||||
return c.ID.Str()
|
||||
}
|
||||
|
||||
func (c *Cache) List(t backend.Type) ([]CacheEntry, error) {
|
||||
func (c *Cache) list(t backend.Type) ([]cacheEntry, error) {
|
||||
var dir string
|
||||
|
||||
switch t {
|
||||
|
@ -145,7 +145,7 @@ func (c *Cache) List(t backend.Type) ([]CacheEntry, error) {
|
|||
fd, err := os.Open(dir)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return []CacheEntry{}, nil
|
||||
return []cacheEntry{}, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ func (c *Cache) List(t backend.Type) ([]CacheEntry, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
entries := make([]CacheEntry, 0, len(fis))
|
||||
entries := make([]cacheEntry, 0, len(fis))
|
||||
|
||||
for _, fi := range fis {
|
||||
parts := strings.SplitN(fi.Name(), ".", 2)
|
||||
|
@ -168,7 +168,7 @@ func (c *Cache) List(t backend.Type) ([]CacheEntry, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
e := CacheEntry{ID: id}
|
||||
e := cacheEntry{ID: id}
|
||||
|
||||
if len(parts) == 2 {
|
||||
e.Subtype = parts[1]
|
||||
|
|
Loading…
Reference in a new issue