github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/query/session_status.go (about)

     1  package query
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/ydb-platform/ydb-go-sdk/v3/internal/session"
     7  )
     8  
     9  type SessionStatus uint32
    10  
    11  const (
    12  	SessionStatusUnknown = SessionStatus(iota)
    13  	SessionStatusReady
    14  	SessionStatusInUse
    15  	SessionStatusClosed
    16  )
    17  
    18  func (s SessionStatus) String() string {
    19  	switch s {
    20  	case 0:
    21  		return session.StatusUnknown
    22  	case 1:
    23  		return session.StatusReady
    24  	case 2:
    25  		return session.StatusBusy
    26  	case 3:
    27  		return session.StatusClosing
    28  	case 4:
    29  		return session.StatusClosed
    30  	default:
    31  		return fmt.Sprintf("unknown_%d", s)
    32  	}
    33  }