Documentation ¶
Index ¶
- type Cache
- func (s *Cache) Changed() bool
- func (s *Cache) Compare(test string, idx uint, content interface{}) *CompareResult
- func (s *Cache) CurrentCount() uint
- func (s *Cache) FailedCount() uint
- func (s *Cache) InsertedCount() uint
- func (s *Cache) RestoreFromFile() error
- func (s *Cache) StoreToFileIfNeeded() (bool, error)
- func (s *Cache) UpdatedCount() uint
- func (s *Cache) VanishedCount() uint
- type CompareResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Filepath string Existed bool IsUpdating bool // contains filtered or unexported fields }
Cache manage snapshot caching
func CreateSnapshotOfSuite ¶
CreateSnapshotOfSuite retruns snapshot.Cache for suite file, create `__snapshot__` dir if not existed
func (*Cache) Compare ¶
func (s *Cache) Compare(test string, idx uint, content interface{}) *CompareResult
Compare compare content to cached last time, return CompareResult
func (*Cache) CurrentCount ¶
CurrentCount return total snapshot count of current time
func (*Cache) FailedCount ¶
FailedCount return snapshot count that was failed when Compare
func (*Cache) InsertedCount ¶
InsertedCount return snapshot count that was newly inserted current time
func (*Cache) RestoreFromFile ¶
RestoreFromFile restore cached snapshot from cache file
func (*Cache) StoreToFileIfNeeded ¶
StoreToFileIfNeeded store current cache to file if snapshot content changed
func (*Cache) UpdatedCount ¶
UpdatedCount return snapshot count that was cached before and updated current time
func (*Cache) VanishedCount ¶
VanishedCount return snapshot count that was cached last time but not exists this time