github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/trace/retry.go (about)

     1  package trace
     2  
     3  // tool gtrace used from ./internal/cmd/gtrace
     4  
     5  //go:generate gtrace
     6  
     7  import (
     8  	"context"
     9  )
    10  
    11  type (
    12  	// Retry specified trace of retry call activity.
    13  	// gtrace:gen
    14  	// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    15  	Retry struct {
    16  		// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    17  		OnRetry func(RetryLoopStartInfo) func(RetryLoopDoneInfo)
    18  	}
    19  	// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    20  	RetryLoopStartInfo struct {
    21  		// Context make available context in trace callback function.
    22  		// Pointer to context provide replacement of context in trace callback function.
    23  		// Warning: concurrent access to pointer on client side must be excluded.
    24  		// Safe replacement of context are provided only inside callback function
    25  		Context *context.Context
    26  
    27  		Call       call
    28  		Label      string
    29  		Idempotent bool
    30  
    31  		NestedCall bool // a sign for detect Retry calls inside head Retry
    32  	}
    33  	// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    34  	RetryLoopDoneInfo struct {
    35  		Attempts int
    36  		Error    error
    37  	}
    38  )