Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 165 for mock (0.16 sec)

  1. cmd/sts-handlers_test.go

    	}
    
    	// Generate web identity STS token by interacting with OpenID IDP.
    	token, err := MockOpenIDTestUserInteraction(ctx, testAppParams, "******@****.***", "dillon")
    	if err != nil {
    		c.Fatalf("mock user err: %v", err)
    	}
    	// fmt.Printf("TOKEN: %s\n", token)
    
    	webID := cr.STSWebIdentity{
    		Client:      s.TestSuiteCommon.client,
    		STSEndpoint: s.endPoint,
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 18 19:09:19 GMT 2024
    - 84.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/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)
  6. 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)
  7. 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)
  8. 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)
  9. internal/dsync/locked_rand.go

    func (r *lockedRandSource) Int63() (n int64) {
    	r.lk.Lock()
    	n = r.src.Int63()
    	r.lk.Unlock()
    	return
    }
    
    // Seed uses the provided seed value to initialize the generator to a
    // deterministic state.
    func (r *lockedRandSource) Seed(seed int64) {
    	r.lk.Lock()
    	r.src.Seed(seed)
    	r.lk.Unlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  10. cmd/untar.go

    	r  io.Reader
    	mu sync.Mutex
    }
    
    func (d *disconnectReader) Read(p []byte) (n int, err error) {
    	d.mu.Lock()
    	defer d.mu.Unlock()
    	if d.r != nil {
    		return d.r.Read(p)
    	}
    	return 0, errors.New("reader closed")
    }
    
    func (d *disconnectReader) Close() error {
    	d.mu.Lock()
    	d.r = nil
    	d.mu.Unlock()
    	return nil
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top