cmd

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CLIConfigurationFile = "topaz.json"
)

Variables

This section is empty.

Functions

func PromptYesNo added in v0.32.0

func PromptYesNo(label string, def bool) bool

Types

type BackupCmd

type BackupCmd struct{}

func (*BackupCmd) Run added in v0.0.16

func (cmd *BackupCmd) Run(c *cc.CommonCtx) error

type CLI

type CLI struct {
	Run        RunCmd                   `cmd:"" help:"run topaz in console mode"`
	Start      StartCmd                 `cmd:"" help:"start topaz in daemon mode"`
	Stop       StopCmd                  `cmd:"" help:"stop topaz instance"`
	Restart    RestartCmd               `cmd:"" help:"restart topaz instance"`
	Status     StatusCmd                `cmd:"" help:"status of topaz daemon process"`
	Manifest   ManifestCmd              `cmd:"" help:"manifest commands"`
	Templates  TemplateCmd              `cmd:"" help:"template commands"`
	Console    ConsoleCmd               `cmd:"" help:"open console in the browser"`
	Directory  directory.DirectoryCmd   `cmd:"" aliases:"ds" help:"directory commands"`
	Authorizer authorizer.AuthorizerCmd `cmd:"" aliases:"az" help:"authorizer commands"`
	Config     ConfigCmd                `cmd:"" help:"configure topaz service"`
	Certs      CertsCmd                 `cmd:"" help:"cert commands"`
	Install    InstallCmd               `cmd:"" help:"install topaz container"`
	Uninstall  UninstallCmd             `cmd:"" help:"uninstall topaz container"`
	Update     UpdateCmd                `cmd:"" help:"update topaz container version"`
	Version    VersionCmd               `cmd:"" help:"version information"`
	NoCheck    bool                     `name:"no-check" json:"noCheck,omitempty" short:"N" env:"TOPAZ_NO_CHECK" help:"disable local container status check"`
	LogLevel   int                      `name:"log" short:"L" type:"counter" default:"0" help:"log level"`
	Import     ImportCmd                `cmd:"" help:"'topaz import' was moved to 'topaz directory import'" hidden:""`
	Export     ExportCmd                `cmd:"" help:"'topaz export' was moved to 'topaz directory export'" hidden:""`
	Backup     BackupCmd                `cmd:"" help:"'topaz backup' was moved to 'topaz directory backup'" hidden:""`
	Restore    RestoreCmd               `cmd:"" help:"'topaz restore' was moved to 'topaz directory restore'" hidden:""`
	Configure  ConfigureCmd             `cmd:"" help:"'topaz configure' was moved to 'topaz config new'" hidden:""`
	Test       TestCmd                  `cmd:"" help:"'topaz test' was moved to 'topaz directory test'" hidden:""`
}

type CertsCmd added in v0.30.25

type CertsCmd struct {
	List     ListCertsCmd      `cmd:"" help:"list dev certs"`
	Generate GenerateCertsCmd  `cmd:"" help:"generate dev certs"`
	Trust    TrustCertsCmd     `cmd:"" help:"trust/untrust dev certs"`
	Remove   RemoveCertFileCmd `cmd:"" help:"remove dev certs"`
}

type ConfigCmd added in v0.32.0

type ConfigCmd struct {
	Use    UseConfigCmd    `cmd:"" help:"set active configuration"`
	New    NewConfigCmd    `cmd:"" help:"create new configuration"`
	List   ListConfigCmd   `cmd:"" help:"list configurations"`
	Rename RenameConfigCmd `cmd:"" help:"rename configuration"`
	Delete DeleteConfigCmd `cmd:"" help:"delete configuration"`
}

func (*ConfigCmd) Run added in v0.32.0

func (cmd *ConfigCmd) Run(c *cc.CommonCtx) error

type ConfigName added in v0.32.0

type ConfigName string

func (ConfigName) AfterApply added in v0.32.0

func (c ConfigName) AfterApply(ctx *kong.Context) error

func (ConfigName) String added in v0.32.0

func (c ConfigName) String() string

type ConfigureCmd

type ConfigureCmd struct{}

func (*ConfigureCmd) Run

func (cmd *ConfigureCmd) Run(c *cc.CommonCtx) error

type ConsoleCmd added in v0.30.0

type ConsoleCmd struct {
	ConsoleAddress string `arg:""  default:"https://localhost:8080/ui/directory" help:"gateway address of the console service"`
}

func (*ConsoleCmd) Run added in v0.30.0

func (cmd *ConsoleCmd) Run(c *cc.CommonCtx) error

type DeleteConfigCmd added in v0.32.0

type DeleteConfigCmd struct {
	Name      ConfigName `arg:"" required:"" help:"topaz config name"`
	ConfigDir string     `flag:"" required:"false" default:"${topaz_cfg_dir}" help:"path to config folder" `
}

func (*DeleteConfigCmd) Run added in v0.32.0

func (cmd *DeleteConfigCmd) Run(c *cc.CommonCtx) error

type DeleteManifestCmd added in v0.30.0

type DeleteManifestCmd struct {
	Force bool `flag:"" help:"do not ask for conformation to delete manifest"`
	clients.DirectoryConfig
}

func (*DeleteManifestCmd) Run added in v0.30.0

func (cmd *DeleteManifestCmd) Run(c *cc.CommonCtx) error

type ExportCmd

type ExportCmd struct{}

func (*ExportCmd) Run added in v0.20.7

func (cmd *ExportCmd) Run(c *cc.CommonCtx) error

type GenerateCertsCmd added in v0.30.25

type GenerateCertsCmd struct {
	CertsDir string   `flag:"" default:"${topaz_certs_dir}" help:"path to dev certs folder" `
	Force    bool     `flag:"" default:"false" help:"force generation of dev certs, overwriting existing cert files"`
	Trust    bool     `flag:"" default:"false" help:"add generated certs to trust store"`
	DNSNames []string `flag:"" default:"localhost" help:"list of DNS names used to generate dev certs"`
}

func (*GenerateCertsCmd) Run added in v0.30.25

func (cmd *GenerateCertsCmd) Run(c *cc.CommonCtx) error

Generate a pair of gateway and grpc certificates.

type GetManifestCmd added in v0.30.0

type GetManifestCmd struct {
	Path   string `arg:"path" help:"filepath to manifest file" type:"path" optional:""`
	Stdout bool   `flag:"" help:"output manifest to --stdout"`
	clients.DirectoryConfig
}

func (*GetManifestCmd) Run added in v0.30.0

func (cmd *GetManifestCmd) Run(c *cc.CommonCtx) error

type ImportCmd

type ImportCmd struct{}

func (*ImportCmd) Run added in v0.20.0

func (cmd *ImportCmd) Run(c *cc.CommonCtx) error

type InstallCmd

type InstallCmd struct {
	ContainerRegistry string `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerPlatform string `optional:"" default:"${container_platform}" env:"CONTAINER_PLATFORM" help:"container platform"`
	ContainerVersion  string `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
}

func (*InstallCmd) Run

func (cmd *InstallCmd) Run(c *cc.CommonCtx) error

type InstallTemplateCmd added in v0.30.24

type InstallTemplateCmd struct {
	Name              string `arg:"" required:"" help:"template name"`
	Force             bool   `flag:"" short:"f" default:"false" required:"false" help:"skip confirmation prompt"`
	NoConfigure       bool   `optional:"" default:"false" help:"do not run configure step, to prevent changes to the config .yaml file"`
	NoTests           bool   `optional:"" default:"false" help:"do not execute assertions as part of template installation"`
	NoConsole         bool   `optional:"" default:"false" help:"do not open console when template installation is finished"`
	ContainerRegistry string `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerPlatform string `optional:"" default:"${container_platform}" env:"CONTAINER_PLATFORM" help:"container platform"`
	ContainerName     string `optional:"" default:"${container_name}" env:"CONTAINER_NAME" help:"container name"`
	ContainerHostname string `optional:"" name:"hostname" default:"" env:"CONTAINER_HOSTNAME" help:"hostname for docker to set"`
	TemplatesURL      string `arg:"" required:"false" default:"https://topaz.sh/assets/templates/templates.json" help:"URL of template catalog"`
	ContainerVersion  string `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
	ConfigName        string `optional:"" help:"set config name"`
	clients.DirectoryConfig
}

func (*InstallTemplateCmd) Run added in v0.30.24

func (cmd *InstallTemplateCmd) Run(c *cc.CommonCtx) error

type ListCertsCmd added in v0.30.25

type ListCertsCmd struct {
	CertsDir string `flag:"" required:"false" default:"${topaz_certs_dir}" help:"path to dev certs folder" `
}

func (*ListCertsCmd) Run added in v0.30.25

func (cmd *ListCertsCmd) Run(c *cc.CommonCtx) error

type ListConfigCmd added in v0.32.0

type ListConfigCmd struct {
	ConfigDir string `flag:"" required:"false" default:"${topaz_cfg_dir}" help:"path to config folder" `
}

func (ListConfigCmd) Run added in v0.32.0

func (cmd ListConfigCmd) Run(c *cc.CommonCtx) error

type ListTemplatesCmd added in v0.30.24

type ListTemplatesCmd struct {
	TemplatesURL string `arg:"" required:"false" default:"https://topaz.sh/assets/templates/templates.json" help:"URL of template catalog"`
}

func (*ListTemplatesCmd) Run added in v0.30.24

func (cmd *ListTemplatesCmd) Run(c *cc.CommonCtx) error

type ManifestCmd added in v0.30.0

type ManifestCmd struct {
	Get    GetManifestCmd    `cmd:"" help:"get manifest"`
	Set    SetManifestCmd    `cmd:"" help:"set manifest"`
	Delete DeleteManifestCmd `cmd:"" help:"delete manifest"`
}

type NewConfigCmd added in v0.32.0

type NewConfigCmd struct {
	Name             ConfigName `short:"n" help:"config name"`
	LocalPolicyImage string     `short:"l" help:"local policy image name"`
	Resource         string     `short:"r" help:"resource url"`
	Stdout           bool       `short:"p" help:"print to stdout"`
	EdgeDirectory    bool       `short:"d" help:"enable edge directory" default:"false"`
	Force            bool       `flag:"" default:"false" short:"f" required:"false" help:"skip confirmation prompt"`
}

func (*NewConfigCmd) Run added in v0.32.0

func (cmd *NewConfigCmd) Run(c *cc.CommonCtx) error

type RemoveCertFileCmd added in v0.30.25

type RemoveCertFileCmd struct {
	CertsDir string `flag:"" required:"false" default:"${topaz_certs_dir}" help:"path to dev certs folder" `
}

func (*RemoveCertFileCmd) Run added in v0.30.25

func (cmd *RemoveCertFileCmd) Run(c *cc.CommonCtx) error

type RenameConfigCmd added in v0.32.0

type RenameConfigCmd struct {
	Name      ConfigName `arg:"" required:"" help:"topaz config name"`
	NewName   ConfigName `arg:"" required:"" help:"topaz new config name"`
	ConfigDir string     `flag:"" required:"false" default:"${topaz_cfg_dir}" help:"path to config folder" `
}

func (*RenameConfigCmd) Run added in v0.32.0

func (cmd *RenameConfigCmd) Run(c *cc.CommonCtx) error

type RestartCmd added in v0.31.5

type RestartCmd struct {
	StartRunCmd
	Wait bool `optional:"" default:"false" help:"wait for ports to be opened"`
}

func (*RestartCmd) Run added in v0.31.5

func (cmd *RestartCmd) Run(c *cc.CommonCtx) error

type RestoreCmd

type RestoreCmd struct{}

func (*RestoreCmd) Run added in v0.0.16

func (cmd *RestoreCmd) Run(c *cc.CommonCtx) error

type RunCmd

type RunCmd struct {
	StartRunCmd
}

func (*RunCmd) Run

func (cmd *RunCmd) Run(c *cc.CommonCtx) error

type SaveContext added in v0.32.0

type SaveContext bool
var (
	Save SaveContext
)

type SetManifestCmd added in v0.30.0

type SetManifestCmd struct {
	Path  string `arg:"" help:"filepath to manifest file" type:"path" optional:""`
	Stdin bool   `flag:"" help:"set manifest from --stdin"`
	clients.DirectoryConfig
}

func (*SetManifestCmd) Run added in v0.30.0

func (cmd *SetManifestCmd) Run(c *cc.CommonCtx) error

type StartCmd

type StartCmd struct {
	StartRunCmd
	Wait bool `optional:"" default:"false" help:"wait for ports to be opened"`
}

func (*StartCmd) Run

func (cmd *StartCmd) Run(c *cc.CommonCtx) error

type StartRunCmd added in v0.31.0

type StartRunCmd struct {
	ContainerRegistry string   `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string   `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string   `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerPlatform string   `optional:"" default:"${container_platform}" env:"CONTAINER_PLATFORM" help:"container platform"`
	ContainerName     string   `optional:"" default:"${container_name}" env:"CONTAINER_NAME" help:"container name"`
	ContainerHostname string   `optional:"" name:"hostname" default:"" env:"CONTAINER_HOSTNAME" help:"hostname for docker to set"`
	Env               []string `optional:"" short:"e" help:"additional environment variable names to be passed to container"`
	ContainerVersion  string   `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
}

type StatusCmd

type StatusCmd struct {
	ContainerName string `optional:"" default:"${container_name}" env:"CONTAINER_NAME" help:"container name"`
}

func (*StatusCmd) Run

func (cmd *StatusCmd) Run(c *cc.CommonCtx) error

type StopCmd

type StopCmd struct {
	ContainerName string `optional:"" default:"${container_name}" env:"CONTAINER_NAME" help:"container name"`
	Wait          bool   `optional:"" default:"false" help:"wait for ports to be closed"`
}

func (*StopCmd) Run

func (cmd *StopCmd) Run(c *cc.CommonCtx) error

type TemplateCmd added in v0.30.24

type TemplateCmd struct {
	List    ListTemplatesCmd   `cmd:"" help:"list template"`
	Install InstallTemplateCmd `cmd:"" help:"install template"`
	Verify  VerifyTemplateCmd  `cmd:"" help:"verify template content links" hidden:""`
}

type TestCmd added in v0.25.8

type TestCmd struct {
	Exec     TestExecCmd     `cmd:"" help:"'topaz test exec' was moved to 'topaz directory test exec'" hidden:""`
	Template TestTemplateCmd `cmd:"" help:"'topaz test template' was moved to 'topaz directory test template'" hidden:""`
}

func (*TestCmd) Run added in v0.32.0

func (cmd *TestCmd) Run(c *cc.CommonCtx) error

type TestExecCmd added in v0.25.8

type TestExecCmd struct{}

func (*TestExecCmd) Run added in v0.25.8

func (cmd *TestExecCmd) Run(c *cc.CommonCtx) error

type TestTemplateCmd added in v0.25.8

type TestTemplateCmd struct{}

func (*TestTemplateCmd) Run added in v0.25.8

func (cmd *TestTemplateCmd) Run(c *cc.CommonCtx) error

type TrustCertsCmd added in v0.30.25

type TrustCertsCmd struct {
	CertsDir string `flag:"" required:"false" default:"${topaz_certs_dir}" help:"path to dev certs folder" `
	Remove   bool   `flag:"" default:"false" help:"remove dev cert from trust store"`
}

func (*TrustCertsCmd) Run added in v0.30.25

func (cmd *TrustCertsCmd) Run(c *cc.CommonCtx) error

type UninstallCmd

type UninstallCmd struct {
	ContainerRegistry string `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerName     string `optional:"" default:"${container_name}" env:"CONTAINER_NAME" help:"container name"`
	ContainerVersion  string `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
}

func (*UninstallCmd) Run

func (cmd *UninstallCmd) Run(c *cc.CommonCtx) error

type UpdateCmd added in v0.20.19

type UpdateCmd struct {
	ContainerRegistry string `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerPlatform string `optional:"" default:"${container_platform}" env:"CONTAINER_PLATFORM" help:"container platform"`
	ContainerVersion  string `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
}

func (*UpdateCmd) Run added in v0.20.19

func (cmd *UpdateCmd) Run(c *cc.CommonCtx) error

type UseConfigCmd added in v0.32.0

type UseConfigCmd struct {
	Name      ConfigName `arg:"" required:"" help:"topaz config name"`
	ConfigDir string     `flag:"" required:"false" default:"${topaz_cfg_dir}" help:"path to config folder" `
}

func (*UseConfigCmd) Run added in v0.32.0

func (cmd *UseConfigCmd) Run(c *cc.CommonCtx) error

type VerifyTemplateCmd added in v0.31.0

type VerifyTemplateCmd struct {
	TemplatesURL string `arg:"" required:"false" default:"https://topaz.sh/assets/templates/templates.json" help:"URL of template catalog"`
}

func (*VerifyTemplateCmd) Run added in v0.31.0

func (cmd *VerifyTemplateCmd) Run(c *cc.CommonCtx) error

type VersionCmd

type VersionCmd struct {
	Container         bool   `short:"c" help:"display topazd container version" default:"false"`
	ContainerRegistry string `optional:"" default:"${container_registry}" env:"CONTAINER_REGISTRY" help:"container registry (host[:port]/repo)"`
	ContainerImage    string `optional:"" default:"${container_image}" env:"CONTAINER_IMAGE" help:"container image name"`
	ContainerTag      string `optional:"" default:"${container_tag}" env:"CONTAINER_TAG" help:"container tag"`
	ContainerPlatform string `optional:"" default:"${container_platform}" env:"CONTAINER_PLATFORM" help:"container platform"`
	ContainerVersion  string `optional:"" hidden:"" default:"" env:"CONTAINER_VERSION"`
}

func (*VersionCmd) Run

func (cmd *VersionCmd) Run(c *cc.CommonCtx) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL