func Prefetch(cmd string, params ...string) { if len(params) == 2 { bucket := params[0] key := params[1] gErr := accountS.Get() if gErr != nil { fmt.Println(gErr) return } mac := digest.Mac{ accountS.AccessKey, []byte(accountS.SecretKey), } err := qshell.Prefetch(&mac, bucket, key) if err != nil { if v, ok := err.(*rpc.ErrorInfo); ok { fmt.Println("Prefetch error,", v.Code, v.Err) } else { fmt.Println("Prefetch error,", err.Error()) } } else { fmt.Println("Prefetch done!") } } else { CmdHelp(cmd) } }
func Prefetch(cmd string, params ...string) { if len(params) == 2 { bucket := params[0] key := params[1] accountS.Get() mac := digest.Mac{ accountS.AccessKey, []byte(accountS.SecretKey), } err := qshell.Prefetch(&mac, bucket, key) if err != nil { log.Error("Prefetch error,", err) } else { fmt.Println("Done!") } } else { CmdHelp(cmd) } }