github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/backoff/type.go (about)

     1  package backoff
     2  
     3  import "fmt"
     4  
     5  // Type reports how to Backoff operation
     6  type Type uint8
     7  
     8  // Binary flags that used as Type
     9  const (
    10  	TypeNoBackoff Type = 1 << iota >> 1
    11  
    12  	TypeFast
    13  	TypeSlow
    14  
    15  	TypeAny = TypeFast | TypeSlow
    16  )
    17  
    18  func (b Type) String() string {
    19  	switch b {
    20  	case TypeNoBackoff:
    21  		return "immediately"
    22  	case TypeFast:
    23  		return "fast backoff"
    24  	case TypeSlow:
    25  		return "slow backoff"
    26  	case TypeAny:
    27  		return "any backoff"
    28  	default:
    29  		return fmt.Sprintf("unknown backoff type %d", b)
    30  	}
    31  }