Documentation ¶
Overview ¶
Package commands contains the definition for all the commands present in Hasura CLI.
Index ¶
- func DeleteVersions(ec *cli.ExecutionContext, versions []uint64, source cli.Source) error
- func Execute() error
- func ExecuteMigration(cmd string, t *migrate.Migrate, stepOrVersion int64) error
- func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error
- func NewActionsCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewCompletionCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewConsoleCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewDefaultHasuraCommand() *cobra.Command
- func NewDefaultHasuraCommandWithArgs(pluginHandler PluginHandler, args []string, in io.Reader, ...) *cobra.Command
- func NewDeployCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewDocsCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewHelpCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewInitCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewMetadataCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewMigrateCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewPluginsCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewScriptsCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewSeedCmd(ec *cli.ExecutionContext) *cobra.Command
- func NewUpdateCLICmd(ec *cli.ExecutionContext) *cobra.Command
- func NewVersionCmd(ec *cli.ExecutionContext) *cobra.Command
- type ConsoleOptions
- type DefaultPluginHandler
- type DeployOptions
- type DiffType
- type InitOptions
- type MetadataApplyOptions
- type MetadataClearOptions
- type MetadataDiffOptions
- type MetadataExportOptions
- type MetadataModeHandler
- type MetadataReloadOptions
- type MigrateApplyOptions
- type MigrateApplyResult
- type MigrateDeleteOptions
- type MigrateStatusOptions
- type PluginHandler
- type PluginInstallOptions
- type PluginUpgradeOptions
- type SeedApplyOptions
- type SeedNewOptions
- type StatusOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteVersions ¶
func ExecuteMigration ¶
ExecuteMigration runs the actual migration
func HandlePluginCommand ¶
func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error
HandlePluginCommand receives a pluginHandler and command-line arguments and attempts to find a plugin executable on the PATH that satisfies the given arguments.
func NewActionsCmd ¶
NewActionsCmd returns the actions command
func NewCompletionCmd ¶
NewCompletionCmd return the completion command.
func NewConsoleCmd ¶
NewConsoleCmd returns the console command
func NewDefaultHasuraCommand ¶
NewDefaultHasuraCommand creates the `hasura` command with default arguments
func NewDefaultHasuraCommandWithArgs ¶
func NewDefaultHasuraCommandWithArgs(pluginHandler PluginHandler, args []string, in io.Reader, out, errout io.Writer) *cobra.Command
NewDefaultHasuraCommandWithArgs creates the `hasura` command with arguments
func NewDeployCmd ¶
func NewDocsCmd ¶
NewDocsCmd returns the docs command
func NewHelpCmd ¶
NewHelpCmd returns the help command
func NewInitCmd ¶
NewInitCmd is the definition for init command
func NewMetadataCmd ¶
NewMetadataCmd returns the metadata command
func NewMigrateCmd ¶
NewMigrateCmd returns the migrate command
func NewPluginsCmd ¶
NewPluginsCmd returns the plugins command
func NewScriptsCmd ¶
NewScriptsCmd returns the scripts command
func NewSeedCmd ¶
NewSeedCmd will return the seed command
func NewUpdateCLICmd ¶
NewUpdateCLICmd returns the update-cli command.
func NewVersionCmd ¶
NewVersionCmd returns the version command
Types ¶
type ConsoleOptions ¶
type ConsoleOptions struct { EC *cli.ExecutionContext APIPort string APIHost *url.URL ConsolePort string Address string DontOpenBrowser bool StaticDir string Browser string UseServerAssets bool DataApiUrl string APIServerInterruptSignal chan os.Signal ConsoleServerInterruptSignal chan os.Signal }
func (*ConsoleOptions) Run ¶
func (o *ConsoleOptions) Run() error
type DefaultPluginHandler ¶
type DefaultPluginHandler struct {
ValidPrefixes []string
}
DefaultPluginHandler implements PluginHandler
func NewDefaultPluginHandler ¶
func NewDefaultPluginHandler(validPrefixes []string) *DefaultPluginHandler
NewDefaultPluginHandler instantiates the DefaultPluginHandler with a list of given filename prefixes used to identify valid plugin filenames.
type DeployOptions ¶
type DeployOptions struct { EC *cli.ExecutionContext WithSeeds bool }
func (*DeployOptions) Run ¶
func (opts *DeployOptions) Run() error
type DiffType ¶
type DiffType string
const DifftypeJSON DiffType = "json"
const DifftypeUnifiedJSON DiffType = "unified-json"
const DifftypeUnifiedYAML DiffType = "unified-yaml"
const DifftypeYAML DiffType = "yaml"
type InitOptions ¶
type InitOptions struct { EC *cli.ExecutionContext Version cli.ConfigVersion Endpoint string AdminSecret string InitDir string GetMetadataMigrations bool }
func (*InitOptions) InitRun ¶
func (o *InitOptions) InitRun() error
func (*InitOptions) Run ¶
func (o *InitOptions) Run() error
type MetadataApplyOptions ¶
type MetadataApplyOptions struct { EC *cli.ExecutionContext FromFile bool DryRun bool DisallowInconsistencies bool // contains filtered or unexported fields }
func (*MetadataApplyOptions) Run ¶
func (o *MetadataApplyOptions) Run() error
type MetadataClearOptions ¶
type MetadataClearOptions struct {
EC *cli.ExecutionContext
}
func (*MetadataClearOptions) Run ¶
func (o *MetadataClearOptions) Run() error
type MetadataDiffOptions ¶
type MetadataDiffOptions struct { EC *cli.ExecutionContext Output io.Writer Args []string DiffType string DisableColor bool // two Metadata to diff, 2nd is server if it's empty Metadata [2]string }
func (*MetadataDiffOptions) Run ¶
func (o *MetadataDiffOptions) Run() error
type MetadataExportOptions ¶
type MetadataExportOptions struct { EC *cli.ExecutionContext // contains filtered or unexported fields }
func (*MetadataExportOptions) Run ¶
func (o *MetadataExportOptions) Run() error
type MetadataModeHandler ¶
type MetadataModeHandler interface { Export(*MetadataExportOptions) error Apply(*MetadataApplyOptions) error Diff(*MetadataDiffOptions) error }
type MetadataReloadOptions ¶
type MetadataReloadOptions struct {
EC *cli.ExecutionContext
}
type MigrateApplyOptions ¶
type MigrateApplyOptions struct { EC *cli.ExecutionContext UpMigration string DownMigration string VersionMigration string MigrationType string // version up to which migration chain has to be applied GotoVersion string SkipExecution bool DryRun bool Source cli.Source ProgressBarLogs bool }
func (*MigrateApplyOptions) Apply ¶
func (o *MigrateApplyOptions) Apply() (chan MigrateApplyResult, error)
func (*MigrateApplyOptions) Exec ¶
func (o *MigrateApplyOptions) Exec() error
func (*MigrateApplyOptions) Run ¶
func (o *MigrateApplyOptions) Run() error
func (*MigrateApplyOptions) Validate ¶
func (o *MigrateApplyOptions) Validate() error
type MigrateApplyResult ¶
type MigrateDeleteOptions ¶
type MigrateDeleteOptions struct { EC *cli.ExecutionContext Version uint64 All bool Force bool OnlyServer bool Source cli.Source }
func (*MigrateDeleteOptions) Run ¶
func (o *MigrateDeleteOptions) Run() error
func (*MigrateDeleteOptions) RunOnSource ¶ added in v2.2.0
func (o *MigrateDeleteOptions) RunOnSource() error
type MigrateStatusOptions ¶
type MigrateStatusOptions struct { EC *cli.ExecutionContext Source cli.Source StatusOpts StatusOptions }
func (*MigrateStatusOptions) Run ¶
func (o *MigrateStatusOptions) Run() error
func (*MigrateStatusOptions) RunOnSource ¶ added in v2.2.0
func (o *MigrateStatusOptions) RunOnSource() (*migrate.Status, error)
type PluginHandler ¶
type PluginHandler interface { // exists at the given filename, or a boolean false. // Lookup will iterate over a list of given prefixes // in order to recognize valid plugin filenames. // The first filepath to match a prefix is returned. Lookup(filename string) (string, bool) // Execute receives an executable's filepath, a slice // of arguments, and a slice of environment variables // to relay to the executable. Execute(executablePath string, cmdArgs, environment []string) error }
PluginHandler is capable of parsing command line arguments and performing executable filename lookups to search for valid plugin files, and execute found plugins. courtesy: kubectl https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go
type PluginInstallOptions ¶
type PluginInstallOptions struct { EC *cli.ExecutionContext Name string ManifestFile string Version util.VersionFlag }
func (*PluginInstallOptions) Run ¶
func (o *PluginInstallOptions) Run() error
type PluginUpgradeOptions ¶
type PluginUpgradeOptions struct { EC *cli.ExecutionContext Name string Version util.VersionFlag }
type SeedApplyOptions ¶
type SeedApplyOptions struct { EC *cli.ExecutionContext Driver *seed.Driver // seed file to apply FileNames []string Source cli.Source }
func (*SeedApplyOptions) ApplyOnSource ¶ added in v2.2.0
func (o *SeedApplyOptions) ApplyOnSource() error
func (*SeedApplyOptions) Run ¶
func (o *SeedApplyOptions) Run() error
type SeedNewOptions ¶
type SeedNewOptions struct { EC *cli.ExecutionContext Driver *seed.Driver // filename for the new seed file SeedName string // table name if seed file has to be created from a database table FromTableNames []string // seed file that was created FilePath string Source cli.Source }
func (*SeedNewOptions) Run ¶
func (o *SeedNewOptions) Run() error
type StatusOptions ¶ added in v2.2.0
Source Files ¶
- actions.go
- actions_codegen.go
- actions_create.go
- actions_use_codegen.go
- completion.go
- console.go
- deploy.go
- docs.go
- help.go
- init.go
- metadata.go
- metadata_apply.go
- metadata_clear.go
- metadata_diff.go
- metadata_export.go
- metadata_handlers.go
- metadata_inconsistency.go
- metadata_inconsistency_drop.go
- metadata_inconsistency_list.go
- metadata_inconsistency_status.go
- metadata_reload.go
- migrate.go
- migrate_apply.go
- migrate_create.go
- migrate_delete.go
- migrate_squash.go
- migrate_status.go
- plugins.go
- plugins_install.go
- plugins_list.go
- plugins_uninstall.go
- plugins_upgrade.go
- root.go
- scripts.go
- scripts_update_config_v2.go
- scripts_update_config_v3.go
- seed.go
- seed_apply.go
- seed_create.go
- update-cli.go
- version.go