aboutsummaryrefslogtreecommitdiff
path: root/cache/cache.go
blob: 32b83257143454f416a1f5507f57c5ae3ae0c2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package cache

import (
	"code.laria.me/petrific/objects"
	"time"
)

type Cache interface {
	PathUpdated(path string) (mtime time.Time, id objects.ObjectId, ok bool)
	SetPathUpdated(path string, mtime time.Time, id objects.ObjectId)
}

type NopCache struct{}

func (NopCache) PathUpdated(_ string) (_ time.Time, _ objects.ObjectId, ok bool) {
	ok = false
	return
}

func (NopCache) SetPathUpdated(_ string, _ time.Time, _ objects.ObjectId) {}