2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2024-05-22 11:11:48 -07:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
|
|
package cache
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/boundary/internal/cmd/base"
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
|
"github.com/posener/complete"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
_ cli.Command = (*StartCommand)(nil)
|
|
|
|
|
_ cli.CommandAutocomplete = (*StartCommand)(nil)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type CacheCommand struct {
|
|
|
|
|
*base.Command
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) Synopsis() string {
|
2026-10-12 10:20:06 -07:00
|
|
|
return "Manages the client side Threshold cache"
|
2024-05-22 11:11:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) Help() string {
|
|
|
|
|
helpText := `
|
2026-10-12 10:20:06 -07:00
|
|
|
Usage: threshold cache [sub command] [options]
|
2024-05-22 11:11:48 -07:00
|
|
|
|
2026-10-12 10:20:06 -07:00
|
|
|
This command allows interacting with the Threshold cache.
|
2024-05-22 11:11:48 -07:00
|
|
|
|
|
|
|
|
Start a cache:
|
|
|
|
|
|
2026-10-12 10:20:06 -07:00
|
|
|
$ threshold cache start
|
2024-05-22 11:11:48 -07:00
|
|
|
|
|
|
|
|
For a full list of examples, please see the documentation.
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
|
return strings.TrimSpace(helpText)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) Flags() *base.FlagSets {
|
|
|
|
|
return c.FlagSet(base.FlagSetNone)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) AutocompleteArgs() complete.Predictor {
|
|
|
|
|
return complete.PredictNothing
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) AutocompleteFlags() complete.Flags {
|
|
|
|
|
return c.Flags().Completions()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *CacheCommand) Run(args []string) int {
|
|
|
|
|
if len(args) >= 2 && args[1] == "daemon" {
|
2026-10-12 10:20:06 -07:00
|
|
|
c.UI.Warn("The `threshold daemon` command is deprecated, use `threshold cache` instead")
|
2024-05-22 11:11:48 -07:00
|
|
|
}
|
|
|
|
|
return cli.RunResultHelp
|
|
|
|
|
}
|