本文整理匯總了Golang中github.com/youtube/vitess/go/vt/tabletmanager/tmclient.TabletManagerClient.SetReadOnly方法的典型用法代碼示例。如果您正苦於以下問題:Golang TabletManagerClient.SetReadOnly方法的具體用法?Golang TabletManagerClient.SetReadOnly怎麽用?Golang TabletManagerClient.SetReadOnly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/youtube/vitess/go/vt/tabletmanager/tmclient.TabletManagerClient
的用法示例。
在下文中一共展示了TabletManagerClient.SetReadOnly方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: agentRPCTestSetReadOnly
func agentRPCTestSetReadOnly(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
testSetReadOnlyExpectedValue = true
err := client.SetReadOnly(ctx, tablet)
if err != nil {
t.Errorf("SetReadOnly failed: %v", err)
}
testSetReadOnlyExpectedValue = false
err = client.SetReadWrite(ctx, tablet)
if err != nil {
t.Errorf("SetReadWrite failed: %v", err)
}
}
示例2: agentRpcTestSetReadOnly
func agentRpcTestSetReadOnly(t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
testSetReadOnlyExpectedValue = true
err := client.SetReadOnly(ti, time.Minute)
if err != nil {
t.Errorf("SetReadOnly failed: %v", err)
}
testSetReadOnlyExpectedValue = false
err = client.SetReadWrite(ti, time.Minute)
if err != nil {
t.Errorf("SetReadWrite failed: %v", err)
}
}
示例3: agentRPCTestSetReadOnlyPanic
func agentRPCTestSetReadOnlyPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
err := client.SetReadOnly(ctx, tablet)
expectRPCWrapLockActionPanic(t, err)
}
示例4: agentRPCTestSetReadOnlyPanic
func agentRPCTestSetReadOnlyPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
err := client.SetReadOnly(ctx, tablet)
expectHandleRPCPanic(t, "SetReadOnly", true /*verbose*/, err)
err = client.SetReadWrite(ctx, tablet)
expectHandleRPCPanic(t, "SetReadWrite", true /*verbose*/, err)
}