Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 19 of 19 for WithContext (0.23 sec)

  1. tests/scopes_test.go

    	}).Find(&users1)
    
    	if result.RowsAffected != 2 {
    		t.Errorf("Should found two users's name in 1, 2, but got %v", result.RowsAffected)
    	}
    
    	var maxId int64
    	userTable := func(db *gorm.DB) *gorm.DB {
    		return db.WithContext(context.Background()).Table("users")
    	}
    	if err := DB.Scopes(userTable).Select("max(id)").Scan(&maxId).Error; err != nil {
    		t.Errorf("select max(id)")
    	}
    }
    
    func TestComplexScopes(t *testing.T) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  2. cmd/http-tracer.go

    		tc := mcontext.TraceCtxt{
    			AmzReqID:         w.Header().Get(xhttp.AmzRequestID),
    			RequestRecorder:  reqRecorder,
    			ResponseRecorder: respRecorder,
    		}
    
    		r = r.WithContext(context.WithValue(r.Context(), mcontext.ContextTraceKey, &tc))
    
    		reqStartTime := time.Now().UTC()
    		h.ServeHTTP(respRecorder, r)
    		reqEndTime := time.Now().UTC()
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 5.9K bytes
    - Viewed (0)
  3. internal/handlers/forwarder.go

    	outReq.ProtoMajor = 1
    	outReq.ProtoMinor = 1
    
    	f.rewriter.Rewrite(outReq)
    
    	// Disable closeNotify when method GET for http pipelining
    	if outReq.Method == http.MethodGet {
    		quietReq := outReq.WithContext(context.Background())
    		*outReq = *quietReq
    	}
    }
    
    // headerRewriter is responsible for removing hop-by-hop headers and setting forwarding headers
    type headerRewriter struct{}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 07 05:42:10 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  4. internal/rest/client.go

    		Method:     http.MethodPost,
    		URL:        &u,
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		Header:     make(http.Header),
    		Body:       rc,
    		Host:       u.Host,
    	}
    	req = req.WithContext(ctx)
    	if body != nil {
    		switch v := body.(type) {
    		case *bytes.Buffer:
    			req.ContentLength = int64(v.Len())
    			buf := v.Bytes()
    			req.GetBody = func() (io.ReadCloser, error) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14K bytes
    - Viewed (0)
  5. tests/transaction_test.go

    func TestCancelTransaction(t *testing.T) {
    	ctx := context.Background()
    	ctx, cancelFunc := context.WithCancel(ctx)
    	cancelFunc()
    
    	user := *GetUser("cancel_transaction", Config{})
    	DB.Create(&user)
    
    	err := DB.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
    		var result User
    		tx.First(&result, user.ID)
    		return nil
    	})
    
    	if err == nil {
    		t.Fatalf("Transaction should get error when using cancelled context")
    	}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. api/go1.7.txt

    pkg net/http, const StatusVariantAlsoNegotiates = 506
    pkg net/http, const StatusVariantAlsoNegotiates ideal-int
    pkg net/http, method (*Request) Context() context.Context
    pkg net/http, method (*Request) WithContext(context.Context) *Request
    pkg net/http, type Request struct, Response *Response
    pkg net/http, type Response struct, Uncompressed bool
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Jun 28 15:08:11 GMT 2016
    - 13.6K bytes
    - Viewed (0)
  7. cmd/admin-router.go

    	handlerName := getHandlerName(f, "adminAPIHandlers")
    
    	var handler http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) {
    		// Update request context with `logger.ReqInfo`.
    		r = r.WithContext(newContext(r, w, handlerName))
    
    		defer logger.AuditLog(r.Context(), w, r, mustGetClaimsFromToken(r))
    
    		// Check if object layer is available, if not return error early.
    		if !handlerFlags.Has(noObjLayerFlag) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Mar 10 21:09:36 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  8. okhttp-android/src/main/baseline-prof.txt

    HSPLkotlin/TuplesKt;-><clinit>()V
    HSPLkotlin/TuplesKt;->launch$default(Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
    HSPLkotlin/TuplesKt;->withContext(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
    HSPLkotlin/UNINITIALIZED_VALUE;-><clinit>()V
    HSPLkotlin/UNINITIALIZED_VALUE;-><init>()V
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Mar 21 11:22:00 GMT 2022
    - 127.9K bytes
    - Viewed (0)
  9. CHANGELOG/CHANGELOG-1.27.md

    - Callers of `wait.ExponentialBackoffWithContext` now must pass a `ConditionWithContextFunc` to be consistent with the signature and avoid creating a duplicate context. If your condition does not need a context you can use the `ConditionFunc.WithContext()` helper to ignore the context, or use `ExponentialBackoff` directly. ([#115113](https://github.com/kubernetes/kubernetes/pull/115113), [@smarterclayton](https://github.com/smarterclayton))
    Plain Text
    - Registered: Fri May 03 09:05:14 GMT 2024
    - Last Modified: Tue Apr 16 15:20:21 GMT 2024
    - 434.3K bytes
    - Viewed (3)
Back to top