コード例 #1
0
ファイル: main.go プロジェクト: tradia/gotable
func set(c *table.Context, done chan *table.Call, zop bool,
	rowKey, colKey, value []byte, score int64) {
	var err error
	if zop {
		if done == nil {
			err = c.ZSet(0, rowKey, colKey, value, score, 0)
		} else {
			_, err = c.GoZSet(0, rowKey, colKey, value, score, 0, done)
		}
	} else {
		if done == nil {
			err = c.Set(0, rowKey, colKey, value, score, 0)
		} else {
			_, err = c.GoSet(0, rowKey, colKey, value, score, 0, done)
		}
	}
	if err != nil {
		fmt.Printf("Set failed: %s\n", err)
		os.Exit(1)
	}

	if *verbose != 0 && done == nil {
		fmt.Printf("rowKey: %2s, colKey: %s\n", string(rowKey), string(colKey))
	}
}