cmd

package
v0.30.31 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckUnknown checkType = iota
	Check
	CheckRelation
	CheckPermission
	CheckDecision
)

Variables

View Source
var ErrNotRunning = errors.New("topaz is not running, use 'topaz start' or 'topaz run' to start")

Functions

func CheckRunning added in v0.20.17

func CheckRunning(c *cc.CommonCtx) error

func Retry added in v0.30.25

func Retry(timeout, interval time.Duration, f func() error) (err error)

Types

type BackupCmd

type BackupCmd struct {
	File   string        `arg:""  default:"backup.tar.gz" help:"absolute file path to make backup to"`
	Format FormatVersion `flag:"" short:"f" enum:"3,2" name:"format" default:"3" help:"format of json data"`
	clients.Config
}

func (*BackupCmd) Run added in v0.0.16

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

type CLI

type CLI struct {
	Start     StartCmd     `cmd:"" help:"start topaz in daemon mode"`
	Stop      StopCmd      `cmd:"" help:"stop topaz instance"`
	Status    StatusCmd    `cmd:"" help:"status of topaz daemon process"`
	Run       RunCmd       `cmd:"" help:"run topaz in console mode"`
	Manifest  ManifestCmd  `cmd:"" help:"manifest commands"`
	Test      TestCmd      `cmd:"" help:"test assertions commands"`
	Templates TemplateCmd  `cmd:"" help:"template commands"`
	Console   ConsoleCmd   `cmd:"" help:"open console in the browser"`
	Import    ImportCmd    `cmd:"" help:"import directory objects"`
	Export    ExportCmd    `cmd:"" help:"export directory objects"`
	Backup    BackupCmd    `cmd:"" help:"backup directory data"`
	Restore   RestoreCmd   `cmd:"" help:"restore directory data"`
	Install   InstallCmd   `cmd:"" help:"install topaz container"`
	Configure ConfigureCmd `cmd:"" help:"configure topaz service"`
	Certs     CertsCmd     `cmd:"" help:"cert commands"`
	Update    UpdateCmd    `cmd:"" help:"update topaz container version"`
	Uninstall UninstallCmd `cmd:"" help:"uninstall topaz container"`
	Load      LoadCmd      `cmd:"" help:"load manifest from file (DEPRECATED)"`
	Save      SaveCmd      `cmd:"" help:"save manifest to file  (DEPRECATED)"`
	Version   VersionCmd   `cmd:"" help:"version information"`
	NoCheck   bool         `name:"no-check" short:"N" env:"TOPAZ_NO_CHECK" help:"disable local container status check"`
}

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 ConfigureCmd

type ConfigureCmd struct {
	PolicyName        string `short:"n" help:"policy name"`
	LocalPolicyImage  string `short:"l" help:"local policy image name"`
	Resource          string `short:"r" help:"resource url"`
	Stdout            bool   `short:"p" help:"generated configuration is printed to stdout but not saved"`
	EdgeDirectory     bool   `short:"d" help:"enable edge directory" default:"false"`
	Force             bool   `flag:"" default:"false" short:"f" required:"false" help:"forcefully create configuration"`
	EnableDirectoryV2 bool   `flag:"" name:"enable-v2" hidden:"" default:"true" help:"enable directory version 2 services for backwards compatibility"`
}

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 DeleteManifestCmd added in v0.30.0

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

func (*DeleteManifestCmd) Run added in v0.30.0

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

type ExportCmd

type ExportCmd struct {
	Directory string        `short:"d" required:"" help:"directory to write .json data"`
	Format    FormatVersion `flag:"" short:"f" enum:"3,2" name:"format" default:"3" help:"format of json data"`
	clients.Config
}

func (*ExportCmd) Run added in v0.20.7

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

type FormatVersion added in v0.30.1

type FormatVersion int
const (
	V2 FormatVersion = 2
	V3 FormatVersion = 3
)

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.Config
}

func (*GetManifestCmd) Run added in v0.30.0

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

type ImportCmd

type ImportCmd struct {
	Directory string        `short:"d" required:"" help:"directory containing .json data"`
	Format    FormatVersion `flag:"" short:"f" enum:"3,2" name:"format" default:"3" help:"format of json data"`
	clients.Config
}

func (*ImportCmd) Run added in v0.20.0

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

type InstallCmd

type InstallCmd struct {
	ContainerName    string `optional:""  default:"topaz" help:"container name"`
	ContainerVersion string `optional:""  default:"latest" help:"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"`
	ContainerName    string `optional:"" default:"topaz" help:"container name"`
	ContainerVersion string `optional:"" default:"latest" help:"container version" `
	TemplatesURL     string `arg:"" required:"false" default:"https://topaz.sh/assets/templates/templates.json" help:"URL of template catalog"`

	clients.Config
}

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 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 LoadCmd

type LoadCmd struct {
	Path string `arg:"" type:"existingfile" default:"manifest.yaml" help:"absolute path to manifest file"`
	clients.Config
}

func (*LoadCmd) Run added in v0.20.0

func (cmd *LoadCmd) 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 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 RestoreCmd

type RestoreCmd struct {
	File   string        `arg:""  default:"backup.tar.gz" help:"absolute file path to local backup tarball"`
	Format FormatVersion `flag:"" short:"f" enum:"3,2" name:"format" default:"3" help:"format of json data"`
	clients.Config
}

func (*RestoreCmd) Run added in v0.0.16

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

type RunCmd

type RunCmd struct {
	ContainerName    string   `optional:"" default:"topaz" help:"container name"`
	ContainerVersion string   `optional:"" default:"latest" help:"container version" `
	Hostname         string   `optional:"" help:"hostname for docker to set"`
	Env              []string `optional:"" short:"e" help:"additional environment variable names to be passed to container"`
}

func (*RunCmd) Run

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

type SaveCmd

type SaveCmd struct {
	File string `arg:"" type:"path" default:"manifest.yaml" help:"absolute path to manifest file"`
	clients.Config
}

func (*SaveCmd) Run added in v0.20.7

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

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.Config
}

func (*SetManifestCmd) Run added in v0.30.0

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

type StartCmd

type StartCmd struct {
	ContainerName    string   `optional:"" default:"topaz" help:"container name"`
	ContainerVersion string   `optional:"" default:"latest" help:"container version" `
	Hostname         string   `optional:"" help:"hostname for docker to set"`
	Env              []string `optional:"" short:"e" help:"additional environment variable names to be passed to container"`
}

func (*StartCmd) Run

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

type StatusCmd

type StatusCmd struct{}

func (StatusCmd) Run

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

type StopCmd

type StopCmd struct{}

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"`
}

type TestCmd added in v0.25.8

type TestCmd struct {
	Exec     TestExecCmd     `cmd:"" help:"execute assertions"`
	Template TestTemplateCmd `cmd:"" help:"output assertions template"`
}

type TestExecCmd added in v0.25.8

type TestExecCmd struct {
	File    string `arg:""  default:"assertions.json" help:"filepath to assertions file"`
	NoColor bool   `flag:"" default:"false" help:"disable colorized output"`
	Summary bool   `flag:"" default:"false" help:"display test summary"`

	clients.Config
	// contains filtered or unexported fields
}

func (*TestExecCmd) Run added in v0.25.8

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

nolint: funlen,gocyclo

type TestTemplateCmd added in v0.25.8

type TestTemplateCmd struct {
	V2     bool `flag:"" default:"false" help:"use v2 template"`
	Pretty bool `flag:"" default:"false" help:"pretty print JSON"`
}

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{}

func (UninstallCmd) Run

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

type UpdateCmd added in v0.20.19

type UpdateCmd struct {
	ContainerName    string `optional:"" default:"topaz" help:"container name"`
	ContainerVersion string `optional:"" default:"latest" help:"container version" `
	Hostname         string `optional:"" help:"hostname for docker to set"`
}

func (UpdateCmd) Run added in v0.20.19

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

type VersionCmd

type VersionCmd struct {
	Container        bool   `short:"c" help:"display topazd container version" default:"false"`
	ContainerName    string `optional:"" default:"topaz" help:"container name"`
	ContainerVersion string `optional:"" default:"latest" help:"container version"`
	Platform         string `optional:"" default:"linux/amd64" help:"set platform if server is multi-platform capable"`
}

func (*VersionCmd) Run

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

Jump to

Keyboard shortcuts

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