github.com/cyverse/go-irodsclient@v0.13.2/irods/types/data_object_lock.go (about) 1 package types 2 3 // DataObjectLockType is a type for data object lock type 4 type DataObjectLockType string 5 6 const ( 7 // DataObjectLockTypeRead is for read lock 8 DataObjectLockTypeRead DataObjectLockType = "readLockType" 9 // DataObjectLockTypeWrite is for write lock 10 DataObjectLockTypeWrite DataObjectLockType = "writeLockType" 11 // DataObjectLockTypeWrite is for write lock 12 DataObjectLockTypeUnlock DataObjectLockType = "unlockType" 13 ) 14 15 // GetFileOpenMode returns FileOpenMode 16 func (t DataObjectLockType) GetFileOpenMode() FileOpenMode { 17 switch t { 18 case DataObjectLockTypeRead: 19 return FileOpenModeReadOnly 20 case DataObjectLockTypeWrite: 21 return FileOpenModeWriteOnly 22 default: 23 return FileOpenModeReadOnly 24 } 25 } 26 27 // DataObjectLockCommand is a type for data object lock command 28 type DataObjectLockCommand string 29 30 const ( 31 // DataObjectLockCommandSetLock is for set lock command 32 DataObjectLockCommandSetLock DataObjectLockCommand = "setLockCmd" 33 // DataObjectLockCommandSetLockWait is for set lock wait command 34 DataObjectLockCommandSetLockWait DataObjectLockCommand = "setLockWaitCmd" 35 // DataObjectLockCommandGetLock is for get lock command 36 DataObjectLockCommandGetLock DataObjectLockCommand = "getLockCmd" 37 )