Documentation ¶
Index ¶
- func ConfirmPrompt(msg, help string, def bool) (bool, error)
- func HasRillProject(dir string) bool
- 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) AdminURL() 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) LoadProject(ctx context.Context, path string) (*adminv1.Project, error)
- func (h *Helper) OpenRuntimeClient(ctx context.Context, org, project string, local bool) (*runtimeclient.Client, string, error)
- func (h *Helper) ProjectNamesByGithubURL(ctx context.Context, org, githubURL, subPath string) ([]string, error)
- func (h *Helper) ReloadAdminConfig() 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 HasRillProject ¶ added in v0.50.0
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 Interactive bool Org string AdminURLDefault string AdminURLOverride string AdminTokenDefault string AdminTokenOverride string // contains filtered or unexported fields }
func (*Helper) AdminToken ¶ added in v0.42.0
func (*Helper) CurrentUserID ¶ added in v0.42.0
CurrentUserID 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) LoadProject ¶ added in v0.49.0
LoadProject loads the cloud project identified by the .rillcloud directory at the given path. It returns an error if the caller is not authenticated. If there is no .rillcloud directory, it returns a nil project an no error.
func (*Helper) OpenRuntimeClient ¶ added in v0.49.0
func (h *Helper) OpenRuntimeClient(ctx context.Context, org, project string, local bool) (*runtimeclient.Client, string, error)
OpenRuntimeClient opens a client for the production deployment for the given project. If local is true, it connects to the locally running runtime instead of the deployed project's runtime. It returns the runtime client and instance ID for the project.
func (*Helper) ProjectNamesByGithubURL ¶ added in v0.42.0
func (*Helper) ReloadAdminConfig ¶ added in v0.49.0
ReloadAdminConfig populates the helper's AdminURL, AdminTokenDefault, and Org properties from ~/.rill.
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