mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-20 12:00:48 -05:00
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
package flagset
|
|
|
|
import (
|
|
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
"github.com/owncloud/ocis/settings/pkg/config"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// HealthWithConfig applies cfg to the root flagset
|
|
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
return []cli.Flag{
|
|
&cli.StringFlag{
|
|
Name: "debug-addr",
|
|
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9194"),
|
|
Usage: "Address to debug endpoint",
|
|
EnvVars: []string{"SETTINGS_DEBUG_ADDR"},
|
|
Destination: &cfg.Debug.Addr,
|
|
},
|
|
}
|
|
}
|
|
|
|
// ListSettingsWithConfig applies list command flags to cfg
|
|
func ListSettingsWithConfig(cfg *config.Config) []cli.Flag {
|
|
return []cli.Flag{
|
|
&cli.StringFlag{
|
|
Name: "grpc-namespace",
|
|
Value: flags.OverrideDefaultString(cfg.GRPC.Namespace, "com.owncloud.api"),
|
|
Usage: "Set the base namespace for the grpc namespace",
|
|
EnvVars: []string{"SETTINGS_GRPC_NAMESPACE"},
|
|
Destination: &cfg.GRPC.Namespace,
|
|
},
|
|
&cli.StringFlag{
|
|
Name: "name",
|
|
Value: flags.OverrideDefaultString(cfg.Service.Name, "settings"),
|
|
Usage: "service name",
|
|
EnvVars: []string{"SETTINGS_NAME"},
|
|
Destination: &cfg.Service.Name,
|
|
},
|
|
}
|
|
}
|