/
githubmirror
/
ydb-go-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-go-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
operation/example_test.go
31 строка
792 B
Aleksey Myasnikov
fix
17 фев 2026, 18:20
17 фев 2026, 18:20
3142fe1
Код
Авторство
О чём код?
package operation_test import ( "context" "fmt" "github.com/ydb-platform/ydb-go-sdk/v3" ) func Example_listOperations() { ctx := context.TODO() db, err := ydb.Open(ctx, "grpc://localhost:2136/local") if err != nil { panic(err) } defer db.Close(ctx) // cleanup resources operations, err := db.Operation().ListBuildIndex(ctx) if err != nil { panic(err) } fmt.Printf("operations:\n") for _, op := range operations.Operations { fmt.Printf(" - operation %q:", op.ID) fmt.Printf(" - ConsumedUnits %f", op.ConsumedUnits) fmt.Printf(" - Ready %v", op.Ready) fmt.Printf(" - Status %q", op.Status) fmt.Printf(" - State %q", op.Metadata.State) fmt.Printf(" - Description %q", op.Metadata.Description) fmt.Printf(" - Progress %f", op.Metadata.Progress) } }