Documentation ¶
Overview ¶
Example (DiscoverCluster) ¶
ctx := context.TODO() db, err := ydb.Open(ctx, "grpcs://localhost:2135/local") if err != nil { fmt.Printf("failed to connect: %v", err) return } defer db.Close(ctx) // cleanup resources endpoints, err := db.Discovery().Discover(ctx) if err != nil { fmt.Printf("discover failed: %v", err) return } fmt.Printf("%s endpoints:\n", db.Name()) for i, e := range endpoints { fmt.Printf("%d) %s\n", i, e.String()) }
Output:
Example (WhoAmI) ¶
ctx := context.TODO() db, err := ydb.Open(ctx, "grpcs://localhost:2135/local") if err != nil { fmt.Printf("failed to connect: %v", err) return } defer db.Close(ctx) // cleanup resources whoAmI, err := db.Discovery().WhoAmI(ctx) if err != nil { fmt.Printf("discover failed: %v", err) return } fmt.Printf("%s whoAmI: %s\n", db.Name(), whoAmI.String())
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.