cmdutil

package
v0.43.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmPrompt

func ConfirmPrompt(msg, help string, def bool) (bool, error)

func InputPrompt

func InputPrompt(msg, def string) (string, error)

func RepoForProjectPath added in v0.36.0

func RepoForProjectPath(path string) (drivers.RepoStore, string, error)

RepoForProjectPath creates an ad-hoc drivers.RepoStore for a local project file path

func SelectPrompt

func SelectPrompt(msg string, options []string, def string) (string, error)

func SelectPromptIfEmpty

func SelectPromptIfEmpty(input *string, msg string, options []string, def string) error

func SetFlagsByInputPrompts added in v0.26.0

func SetFlagsByInputPrompts(cmd cobra.Command, flags ...string) error

func StringPromptIfEmpty

func StringPromptIfEmpty(input *string, msg string) error

Types

type Helper added in v0.38.0

type Helper struct {
	*printer.Printer
	Version            Version
	AdminURL           string
	AdminTokenOverride string
	AdminTokenDefault  string
	Org                string
	Interactive        bool
	// contains filtered or unexported fields
}

func (*Helper) AdminToken added in v0.42.0

func (h *Helper) AdminToken() string

func (*Helper) Client added in v0.42.0

func (h *Helper) Client() (*client.Client, error)

func (*Helper) Close added in v0.42.0

func (h *Helper) Close() error

func (*Helper) CurrentUserID added in v0.42.0

func (h *Helper) CurrentUserID(ctx context.Context) (string, error)

CurrentUser fetches the ID of the current user. It caches the result in ~/.rill, along with a hash of the current admin token for cache invalidation in case of login/logout.

func (*Helper) InferProjectName added in v0.42.0

func (h *Helper) InferProjectName(ctx context.Context, org, path string) (string, error)

func (*Helper) IsAuthenticated added in v0.42.0

func (h *Helper) IsAuthenticated() bool

func (*Helper) IsDev added in v0.42.0

func (h *Helper) IsDev() bool

func (*Helper) ProjectNamesByGithubURL added in v0.42.0

func (h *Helper) ProjectNamesByGithubURL(ctx context.Context, org, githubURL string) ([]string, error)

func (*Helper) Telemetry added in v0.42.0

func (h *Helper) Telemetry(ctx context.Context) *activity.Client

Telemetry returns a client for recording events. Note: It should only be used for parts of the CLI that run on users' local computer because: a) it accesses ~/.rill and adds information about the current user, b) it sends events to the public intake endpoint instead of directly to Kafka.

type PreRunCheck

type PreRunCheck func(cmd *cobra.Command, args []string) error

func CheckAuth

func CheckAuth(ch *Helper) PreRunCheck

func CheckChain

func CheckChain(chain ...PreRunCheck) PreRunCheck

func CheckOrganization

func CheckOrganization(ch *Helper) PreRunCheck

type Version added in v0.42.0

type Version struct {
	Number    string
	Commit    string
	Timestamp string
}

func (Version) IsDev added in v0.42.0

func (v Version) IsDev() bool

func (Version) String added in v0.42.0

func (v Version) String() string

Jump to

Keyboard shortcuts

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