Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDirNotSet = errors.New("NARADA4D_DIR is not set") ErrDirNotDir = errors.New("NARADA4D_DIR is not a directory") ErrDirNotInitialized = errors.New("NARADA4D_DIR is not initialized") )
Errors returned by Init.
View Source
var ( // Dir is $NARADA4D_DIR. Dir string )
Functions ¶
func ExclusiveLock ¶
func ExclusiveLock()
ExclusiveLock will set exclusive lock, send SetVersion event and wait for the response. You must Unlock before calling ExclusiveLock or SharedLock again.
func SharedLock ¶
func SharedLock()
SharedLock will set shared lock, send SetVersion event and wait for the response. You must Unlock before calling ExclusiveLock or SharedLock again.
Types ¶
type SetVersion ¶
type SetVersion struct {
Version string
Done chan<- struct{}
}
SetVersion is an event sent after successful locking. Event consumer should check is it compatible with Version and either setup data access accordingly to Version and then send to Done or shutdown application without sending to Done.
Click to show internal directories.
Click to hide internal directories.