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

     1  package operation
     2  
     3  import "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations"
     4  
     5  type Mode uint
     6  
     7  const (
     8  	ModeUnknown Mode = iota
     9  	ModeSync
    10  	ModeAsync
    11  )
    12  
    13  func (m Mode) String() string {
    14  	switch m {
    15  	case ModeSync:
    16  		return "sync"
    17  	case ModeAsync:
    18  		return "async"
    19  	default:
    20  		return "unknown"
    21  	}
    22  }
    23  
    24  func (m Mode) toYDB() Ydb_Operations.OperationParams_OperationMode {
    25  	switch m {
    26  	case ModeSync:
    27  		return Ydb_Operations.OperationParams_SYNC
    28  	case ModeAsync:
    29  		return Ydb_Operations.OperationParams_ASYNC
    30  	default:
    31  		return Ydb_Operations.OperationParams_OPERATION_MODE_UNSPECIFIED
    32  	}
    33  }