2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2023-06-11 20:40:47 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
|
|
//go:build amd64 || arm64
|
|
|
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
import (
|
2026-10-12 10:33:41 -07:00
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/clientcache/cmd/cache"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/clientcache/cmd/search"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/cmd/base"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/cmd/wrapper"
|
2023-06-11 20:40:47 -04:00
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
extraCommandsFuncs = append(extraCommandsFuncs, func(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
|
2024-05-22 11:11:48 -07:00
|
|
|
Commands["cache"] = func() (cli.Command, error) {
|
|
|
|
|
return &cache.CacheCommand{
|
2024-01-18 09:54:21 -08:00
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
2024-05-22 11:11:48 -07:00
|
|
|
Commands["cache start"] = func() (cli.Command, error) {
|
|
|
|
|
return &cache.StartCommand{
|
2023-06-11 20:40:47 -04:00
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
2024-05-22 11:11:48 -07:00
|
|
|
Commands["cache stop"] = func() (cli.Command, error) {
|
|
|
|
|
return &cache.StopCommand{
|
2023-06-11 20:40:47 -04:00
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
2024-05-22 11:11:48 -07:00
|
|
|
Commands["cache add-token"] = func() (cli.Command, error) {
|
|
|
|
|
return &cache.AddTokenCommand{
|
2023-06-11 20:40:47 -04:00
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
2024-05-22 11:11:48 -07:00
|
|
|
Commands["cache status"] = func() (cli.Command, error) {
|
|
|
|
|
return &cache.StatusCommand{
|
2023-11-03 14:22:55 -07:00
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
2024-05-22 11:11:48 -07:00
|
|
|
// TODO(johanbrandhorst): remove after deprecation period
|
|
|
|
|
Commands["daemon"] = wrapper.WrapForDeprecation(
|
|
|
|
|
func() wrapper.WrappableCommand {
|
|
|
|
|
return &cache.CacheCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"daemon",
|
|
|
|
|
"cache",
|
|
|
|
|
)
|
|
|
|
|
// TODO(johanbrandhorst): remove after deprecation period
|
|
|
|
|
Commands["daemon start"] = wrapper.WrapForDeprecation(
|
|
|
|
|
func() wrapper.WrappableCommand {
|
|
|
|
|
return &cache.StartCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"daemon",
|
|
|
|
|
"cache",
|
|
|
|
|
)
|
|
|
|
|
// TODO(johanbrandhorst): remove after deprecation period
|
|
|
|
|
Commands["daemon stop"] = wrapper.WrapForDeprecation(
|
|
|
|
|
func() wrapper.WrappableCommand {
|
|
|
|
|
return &cache.StopCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"daemon",
|
|
|
|
|
"cache",
|
|
|
|
|
)
|
|
|
|
|
// TODO(johanbrandhorst): remove after deprecation period
|
|
|
|
|
Commands["daemon add-token"] = wrapper.WrapForDeprecation(
|
|
|
|
|
func() wrapper.WrappableCommand {
|
|
|
|
|
return &cache.AddTokenCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"daemon",
|
|
|
|
|
"cache",
|
|
|
|
|
)
|
|
|
|
|
// TODO(johanbrandhorst): remove after deprecation period
|
|
|
|
|
Commands["daemon status"] = wrapper.WrapForDeprecation(
|
|
|
|
|
func() wrapper.WrappableCommand {
|
|
|
|
|
return &cache.StatusCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"daemon",
|
|
|
|
|
"cache",
|
|
|
|
|
)
|
2023-06-11 20:40:47 -04:00
|
|
|
Commands["search"] = func() (cli.Command, error) {
|
|
|
|
|
return &search.SearchCommand{
|
|
|
|
|
Command: base.NewCommand(ui),
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|