shard := &topo.ShardInfo{ Keyspace: "my_keyspace", ShardingKey: "user_id", KeyRange: key.KeyRange{Start: []byte("0"), End: []byte("100")}, Tablets: make(map[topodatapb.TabletType]*topo.TabletInfo), }
tablet := &topo.TabletInfo{ Alias: &topodatapb.TabletAlias{ Cell: "cell1", Uid: 1, }, Hostname: "localhost", PortMap: map[string]int{"vt": 15001}, } shard.Tablets[topodatapb.TabletType_REPLICA] = tabletBrief Description: The above code examples showcase how to create a new ShardInfo instance and how to add a new tablet to an existing ShardInfo instance. The package library is go github.com.youtube.vitess.go.vt.topo.