github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/grpcwrapper/rawydb/status.go (about) 1 package rawydb 2 3 import "github.com/ydb-platform/ydb-go-genproto/protos/Ydb" 4 5 type StatusCode int 6 7 const ( 8 StatusSuccess = StatusCode(Ydb.StatusIds_SUCCESS) 9 StatusInternalError = StatusCode(Ydb.StatusIds_INTERNAL_ERROR) 10 ) 11 12 func (s *StatusCode) FromProto(p Ydb.StatusIds_StatusCode) error { 13 *s = StatusCode(p) 14 15 return nil 16 } 17 18 func (s StatusCode) IsSuccess() bool { 19 return s == StatusSuccess 20 } 21 22 func (s StatusCode) String() string { 23 return Ydb.StatusIds_StatusCode(s).String() 24 }