Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 194 for mock (0.17 sec)

  1. internal/dsync/lock-args.go

    // LockArgs is minimal required values for any dsync compatible lock operation.
    type LockArgs struct {
    	// Unique ID of lock/unlock request.
    	UID string
    
    	// Resources contains single or multiple entries to be locked/unlocked.
    	Resources []string
    
    	// Source contains the line number, function and file name of the code
    	// on the client node that requested the lock.
    	Source string
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 04:34:26 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  2. internal/lock/lock_windows.go

    		}
    	}
    
    	return &LockedFile{File: f}, nil
    }
    
    // TryLockedOpenFile - tries a new write lock, functionality
    // it is similar to LockedOpenFile with with syscall.LOCK_EX
    // mode but along with syscall.LOCK_NB such that the function
    // doesn't wait forever but instead returns if it cannot
    // acquire a write lock.
    func TryLockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Oct 18 18:08:15 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  3. cmd/bucket-object-lock.go

    					return ObjectLocked{}
    				}
    
    				if !ret.RetainUntilDate.Before(t) {
    					return ObjectLocked{}
    				}
    				return nil
    			}
    			// https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes
    			// If you try to delete objects protected by governance mode and have s3:BypassGovernanceRetention, the operation will succeed.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  4. cmd/lock-rest-client_test.go

    	// Attempt all calls.
    	_, err = lkClient.RLock(context.Background(), dsync.LockArgs{})
    	if err == nil {
    		t.Fatal("Expected for Rlock to fail")
    	}
    
    	_, err = lkClient.Lock(context.Background(), dsync.LockArgs{})
    	if err == nil {
    		t.Fatal("Expected for Lock to fail")
    	}
    
    	_, err = lkClient.RUnlock(context.Background(), dsync.LockArgs{})
    	if err == nil {
    		t.Fatal("Expected for RUnlock to fail")
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 2K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/test/cgo_thread_lock.go

    Austin Clements <******@****.***> 1684423194 -0400
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu May 18 16:55:07 GMT 2023
    - 939 bytes
    - Viewed (0)
  6. internal/lsync/lrwmutex.go

    }
    
    // RLock holds a read lock on lm.
    //
    // If one or more read lock are already in use, it will grant another lock.
    // Otherwise the calling go routine blocks until the mutex is available.
    func (lm *LRWMutex) RLock() {
    	const isWriteLock = false
    	lm.lockLoop(context.Background(), lm.id, lm.source, 1<<63-1, isWriteLock)
    }
    
    // GetRLock tries to get a read lock on lm before the timeout occurs.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  7. internal/dsync/dsync-server_test.go

    	// and positive values indicating number of read locks
    	lockMap map[string]int64
    
    	// Refresh returns lock not found if set to true
    	lockNotFound bool
    
    	// Set to true if you want peers servers to do not respond
    	responseDelay int64
    }
    
    func (l *lockServer) setRefreshReply(refreshed bool) {
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jan 23 16:46:37 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  8. cmd/site-replication-metrics.go

    	Endpoint string `json:"-"`
    	// Secure is true if the replication target endpoint is secure
    	Secure bool `json:"-"`
    }
    
    func (sr *SRStats) update(st replStat, dID string) {
    	sr.lock.Lock()
    	defer sr.lock.Unlock()
    	srs, ok := sr.M[dID]
    	if !ok {
    		srs = &SRStatus{
    			XferRateLrg: newXferStats(),
    			XferRateSml: newXferStats(),
    		}
    	}
    	srs.Endpoint = st.Endpoint
    	srs.Secure = st.Secure
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Feb 06 06:00:45 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  9. internal/store/batch.go

    func (b *Batch[K, T]) GetByKey(key K) (T, bool) {
    	b.Lock()
    	defer b.Unlock()
    
    	item, ok := b.items[key]
    	return item, ok
    }
    
    // Len returns the no of items in the batch
    func (b *Batch[K, T]) Len() int {
    	b.Lock()
    	defer b.Unlock()
    
    	return len(b.keys)
    }
    
    // IsFull checks if the batch is full or not
    func (b *Batch[K, T]) IsFull() bool {
    	b.Lock()
    	defer b.Unlock()
    
    	return b.isFull()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Oct 07 15:07:38 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  10. internal/dsync/dsync-client_test.go

    	return false
    }
    
    // Close closes the underlying socket file descriptor.
    func (restClient *ReconnectRESTClient) Close() error {
    	return nil
    }
    
    var (
    	errLockConflict = errors.New("lock conflict")
    	errLockNotFound = errors.New("lock not found")
    )
    
    func toLockError(err error) error {
    	if err == nil {
    		return nil
    	}
    
    	switch err.Error() {
    	case errLockConflict.Error():
    		return errLockConflict
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 20 17:36:09 GMT 2022
    - 4.4K bytes
    - Viewed (0)
Back to top