cli

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 9 Imported by: 0

README

hasuraenv

Latest release Test Static Check Vulnerability Check Go Report Card GitHub license

Hasura CLI version manager

Installation

$ go install github.com/kmtym1998/hasuraenv/cmd/hasuraenv@latest
$ hasuraenv init
$ export PATH=~/.hasuraenv/current:$PATH;

Usage

$ hasuraenv ls-remote --limit 10
INFO Latest 10 releases
     v2.13.0-beta.1
     v2.12.0
     ...

$ hasuraenv install v2.13.0-beta.1

$ hasuraenv ls
INFO Installed hasura cli
     v2.1.0
     v2.9.0
     v2.9.0-beta.3
     v2.13.0-beta.1

$ hasuraenv use v2.13.0-beta.1

$ hasura version
INFO hasura cli                                    version=v2.13.0-beta.1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	Version        string
	ConfigPathBase string
}

func NewBuildOptions

func NewBuildOptions(version, configPathBase string) BuildOptions

type ConfigPath

type ConfigPath struct {
	VersionsDir string
	Current     string
}

type ExecutionContext

type ExecutionContext struct {
	// CMDName is the name of CMD (os.Args[0]). To be filled in later to
	// correctly render example strings etc.
	CMDName        string
	Stderr, Stdout io.Writer

	// ID is a unique ID for this Execution
	ID string

	// IsTerminal indicates whether the current session is a terminal or not
	IsTerminal bool

	// LogLevel indicates the logrus default logging level
	LogLevel string

	// NoColor indicates if the outputs shouldn't be colorized
	NoColor bool

	// Logger is the global logger object to print logs.
	Logger *logrus.Logger

	// Spinner is the global spinner object used to show progress across the cli.
	Spinner *spinner.Spinner

	// Version is the parsed semantic version for CLI
	Version string

	// Viper indicates the viper object for the execution
	Viper *viper.Viper

	GlobalConfig *GlobalConfig
	// contains filtered or unexported fields
}

func NewExecutionContext

func NewExecutionContext(bo BuildOptions) *ExecutionContext

func (*ExecutionContext) Prepare

func (ec *ExecutionContext) Prepare() error

Prepare as the name suggests, prepares the ExecutionContext ec by initializing most of the variables to sensible defaults, if it is not already set.

func (*ExecutionContext) Spin

func (ec *ExecutionContext) Spin(message string)

Spin stops any existing spinner and starts a new one with the given message.

type GlobalConfig

type GlobalConfig struct {
	HasuraenvPath ConfigPath
}

Directories

Path Synopsis
cmd
hasuraenv
Package main is the entrypoint for the command line executable.
Package main is the entrypoint for the command line executable.
internal

Jump to

Keyboard shortcuts

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