MCPcopy Create free account
hub / github.com/Driver-C/tryssh / interactiveDeleteCache

Method interactiveDeleteCache

pkg/control/prune.go:52–72  ·  view source on GitHub ↗
(server config.ServerListConfig)

Source from the content-addressed store, hash-verified

50}
51
52func (pc *PruneController) interactiveDeleteCache(server config.ServerListConfig) bool {
53 reader := bufio.NewReader(os.Stdin)
54 for {
55 fmt.Printf("Are you sure you want to delete this cache? "+
56 "Please enter \"yes\" to confirm deletion, or \"no\" to cancel. %s\n"+
57 "(yes/no): ", server)
58 stdin, _ := reader.ReadString('\n')
59 // Delete space
60 stdin = strings.TrimSpace(stdin)
61 switch stdin {
62 case "yes":
63 utils.Infof("The cache %v has been marked for deletion.", server)
64 return true
65 case "no":
66 utils.Infof("Cache %v skipped.", server)
67 return false
68 default:
69 utils.Errorln("Input error:", stdin)
70 }
71 }
72}
73
74func (pc *PruneController) concurrencyDeleteCache() []config.ServerListConfig {
75 if pc.concurrency < 1 {

Calls 2

InfofFunction · 0.92
ErrorlnFunction · 0.92