atomicpath

package
v0.0.0-...-8291241 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLockShards

func GetLockShards() int

Types

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) GetID

func (f *File) GetID() uint32

func (*File) GetIDStr

func (f *File) GetIDStr() string

func (*File) IsZombie

func (f *File) IsZombie() bool

func (*File) ModTime

func (f *File) ModTime() int64

type FileSystem

type FileSystem struct {
	// contains filtered or unexported fields
}

func NewFileSystem

func NewFileSystem(count int, gc func(id uint32, name string)) *FileSystem

func (*FileSystem) Close

func (fs *FileSystem) Close(f *File)

func (*FileSystem) CreationLock

func (fs *FileSystem) CreationLock(name string, hash uint16, wait bool) bool

CreationLock - if wait is true and the lock was already taken, then it waits for the other thread to finish creating but it doesn't retry to lock after that

func (*FileSystem) CreationUnlock

func (fs *FileSystem) CreationUnlock(name string, hash uint16)

func (*FileSystem) GC

func (fs *FileSystem) GC(ttlSec int64, sleepBetweenDeletes time.Duration)

GC must be called only once at a time

func (*FileSystem) Open

func (fs *FileSystem) Open(name string, hash uint16) (f *File)

Open returns nil if the file does not exist

func (*FileSystem) Refresh

func (h *FileSystem) Refresh(ttlSec int64, sleepBetweenDeletes time.Duration, cb func(id uint32, name string))

func (*FileSystem) Swap

func (fs *FileSystem) Swap(name string, hash uint16, newid uint32, openNew bool) (f *File)

Swap returns the new file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL