Documentation
¶
Index ¶
- func AddGroup(parent *cobra.Command, title string, hidden bool, children ...*cobra.Command)
- func ConfirmPrompt(msg, help string, def bool) (bool, error)
- func EnsureGitignoreHasDotenv(ctx context.Context, repo drivers.RepoStore) (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 GitHelper
- type Helper
- func (h *Helper) AdminToken() string
- func (h *Helper) AdminURL() string
- func (h *Helper) CheckVersion(ctx context.Context) error
- func (h *Helper) Client() (*client.Client, error)
- func (h *Helper) Close() error
- func (h *Helper) CurrentUserID(ctx context.Context) (string, error)
- func (h *Helper) GitHelper(project, localPath string) *GitHelper
- func (h *Helper) GitSignature(ctx context.Context, path string) (*object.Signature, 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) LatestVersion(ctx context.Context) (string, error)
- 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) SetOrg(org string) error
- func (h *Helper) Telemetry(ctx context.Context) *activity.Client
- type PreRunCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureGitignoreHasDotenv ¶ added in v0.64.1
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 GitHelper ¶ added in v0.64.1
type GitHelper struct {
// contains filtered or unexported fields
}
GitHelper manages git operations for a project. It also caches the git credentials for the project. Do not use directly, use cmdutil.Helper to get an instance of GitHelper.
func (*GitHelper) PushToManagedRepo ¶ added in v0.64.1
func (*GitHelper) PushToNewManagedRepo ¶ added in v0.64.1
type Helper ¶ added in v0.38.0
type Helper struct {
*printer.Printer
Version version.Version
DotRill dotrill.DotRill
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) CheckVersion ¶ added in v0.60.7
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) GitSignature ¶ added in v0.64.1
func (*Helper) InferProjectName ¶ added in v0.42.0
func (*Helper) IsAuthenticated ¶ added in v0.42.0
func (*Helper) LatestVersion ¶ added in v0.60.7
LatestVersion returns the latest available version of Rill (cached for up to 24 hours).
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 ¶
PreRunCheck is called before a command is run.
func CheckAuth ¶
func CheckAuth(ch *Helper) PreRunCheck
CheckAuth checks if the user is authenticated.
func CheckChain ¶
func CheckChain(chain ...PreRunCheck) PreRunCheck
func CheckOrganization ¶
func CheckOrganization(ch *Helper) PreRunCheck
CheckOrganization checks if the user has an organization set.