Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 194 for mock (0.14 sec)

  1. tests/sql_builder_test.go

    	// replace SQL quote, convert into postgresql like ""
    	expected = replaceQuoteInSQL(expected)
    	actually = replaceQuoteInSQL(actually)
    
    	// ignore updated_at value, because it's generated in Gorm internal, can't to mock value on update.
    	updatedAtRe := regexp.MustCompile(`(?i)"updated_at"=".+?"`)
    	actually = updatedAtRe.ReplaceAllString(actually, `"updated_at"=?`)
    	expected = updatedAtRe.ReplaceAllString(expected, `"updated_at"=?`)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  2. internal/lock/lock.go

    	*LockedFile
    	mutex sync.Mutex
    	refs  int // Holds read lock refs.
    }
    
    // IsClosed - Check if the rlocked file is already closed.
    func (r *RLockedFile) IsClosed() bool {
    	r.mutex.Lock()
    	defer r.mutex.Unlock()
    	return r.refs == 0
    }
    
    // IncLockRef - is used by called to indicate lock refs.
    func (r *RLockedFile) IncLockRef() {
    	r.mutex.Lock()
    	r.refs++
    	r.mutex.Unlock()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  3. internal/lock/lock_nix.go

    }
    
    // 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) {
    	return lockedOpenFile(path, flag, perm, syscall.LOCK_NB)
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Aug 19 01:35:22 GMT 2021
    - 2.8K bytes
    - Viewed (0)
  4. cmd/lock-rest-server-common.go

    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cmd
    
    import (
    	"errors"
    )
    
    var (
    	errLockConflict       = errors.New("lock conflict")
    	errLockNotInitialized = errors.New("lock not initialized")
    	errLockNotFound       = errors.New("lock not found")
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 973 bytes
    - Viewed (0)
  5. internal/bucket/object/lock/lock.go

    	AmzObjectLockRetainUntilDate     = "X-Amz-Object-Lock-Retain-Until-Date"
    	AmzObjectLockMode                = "X-Amz-Object-Lock-Mode"
    	AmzObjectLockLegalHold           = "X-Amz-Object-Lock-Legal-Hold"
    )
    
    var (
    	// ErrMalformedBucketObjectConfig -indicates that the bucket object lock config is malformed
    	ErrMalformedBucketObjectConfig = errors.New("invalid bucket object lock config")
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 17.1K bytes
    - Viewed (0)
  6. cmd/namespace-lock.go

    	*lsync.LRWMutex
    }
    
    // nsLockMap - namespace lock map, provides primitives to Lock,
    // Unlock, RLock and RUnlock.
    type nsLockMap struct {
    	// Indicates if namespace is part of a distributed setup.
    	isDistErasure bool
    	lockMap       map[string]*nsLock
    	lockMapMutex  sync.Mutex
    }
    
    // Lock the namespace resource.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  7. internal/ioutil/append-file_windows.go

    import (
    	"io"
    	"os"
    
    	"github.com/minio/minio/internal/lock"
    )
    
    // AppendFile - appends the file "src" to the file "dst"
    func AppendFile(dst string, src string, osync bool) error {
    	appendFile, err := lock.Open(dst, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o666)
    	if err != nil {
    		return err
    	}
    	defer appendFile.Close()
    
    	srcFile, err := lock.Open(src, os.O_RDONLY, 0o666)
    	if err != nil {
    		return err
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  8. cmd/erasure-server-pool-rebalance.go

    			ok = true
    		}
    	}
    	if ok {
    		lock := z.serverPools[0].NewNSLock(minioMetaBucket, rebalMetaName)
    		lkCtx, err := lock.GetLock(ctx, globalOperationTimeout)
    		if err != nil {
    			rebalanceLogIf(ctx, fmt.Errorf("failed to acquire write lock on %s/%s: %w", minioMetaBucket, rebalMetaName, err))
    			return err
    		}
    		defer lock.Unlock(lkCtx)
    
    		ctx = lkCtx.Context()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.5K bytes
    - Viewed (0)
  9. cmd/bucket-targets.go

    func (sys *BucketTargetSys) markOffline(ep *url.URL) {
    	sys.hMutex.Lock()
    	defer sys.hMutex.Unlock()
    	if h, ok := sys.hc[ep.Host]; ok {
    		h.Online = false
    		sys.hc[ep.Host] = h
    	}
    }
    
    func (sys *BucketTargetSys) initHC(ep *url.URL) {
    	sys.hMutex.Lock()
    	sys.hc[ep.Host] = epHealth{
    		Endpoint: ep.Host,
    		Scheme:   ep.Scheme,
    		Online:   true,
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  10. internal/dsync/dsync.go

    package dsync
    
    // Dsync represents dsync client object which is initialized with
    // authenticated clients, used to initiate lock REST calls.
    type Dsync struct {
    	// List of rest client objects, one per lock server.
    	GetLockers func() ([]NetLocker, string)
    
    	// Timeouts to apply.
    	Timeouts Timeouts
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Mar 01 19:14:28 GMT 2022
    - 1K bytes
    - Viewed (0)
Back to top