Documentation ¶
Index ¶
- func ConfirmPrompt(msg, help string, def bool) (bool, error)
- func InputPrompt(msg, def string) (string, error)
- func RepoForProjectPath(path string) (drivers.RepoStore, string, error)
- func SelectPrompt(msg string, options []string, def string) (string, error)
- func SelectPromptIfEmpty(input *string, msg string, options []string, def string) error
- func SetFlagsByInputPrompts(cmd cobra.Command, flags ...string) error
- func StringPromptIfEmpty(input *string, msg string) error
- func UploadRepo(ctx context.Context, repo drivers.RepoStore, ch *Helper, org, name string) (string, error)
- type Helper
- func (h *Helper) AdminToken() string
- func (h *Helper) Client() (*client.Client, error)
- func (h *Helper) Close() error
- func (h *Helper) CurrentUserID(ctx context.Context) (string, error)
- func (h *Helper) InferProjectName(ctx context.Context, org, path string) (string, error)
- func (h *Helper) IsAuthenticated() bool
- func (h *Helper) IsDev() bool
- func (h *Helper) ProjectNamesByGithubURL(ctx context.Context, org, githubURL, subPath string) ([]string, error)
- func (h *Helper) Telemetry(ctx context.Context) *activity.Client
- type PreRunCheck
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputPrompt ¶
func RepoForProjectPath ¶ added in v0.36.0
RepoForProjectPath creates an ad-hoc drivers.RepoStore for a local project file path
func SelectPromptIfEmpty ¶
func SetFlagsByInputPrompts ¶ added in v0.26.0
func StringPromptIfEmpty ¶
func UploadRepo ¶ added in v0.47.0
func UploadRepo(ctx context.Context, repo drivers.RepoStore, ch *Helper, org, name string) (string, error)
UploadRepo uploads a local project files to rill managed store. Internally it creates an asset object on admin service and returns its id which can be supplied while creating/updating project.
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 (*Helper) CurrentUserID ¶ added in v0.42.0
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 (*Helper) IsAuthenticated ¶ added in v0.42.0
func (*Helper) ProjectNamesByGithubURL ¶ added in v0.42.0
func (*Helper) Telemetry ¶ added in v0.42.0
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 ¶
func CheckAuth ¶
func CheckAuth(ch *Helper) PreRunCheck
func CheckChain ¶
func CheckChain(chain ...PreRunCheck) PreRunCheck
func CheckOrganization ¶
func CheckOrganization(ch *Helper) PreRunCheck