Documentation
¶
Overview ¶
Package dtproject is the Projects module of the DataTug terminal UI: the list of local and GitHub projects, the screens of an open project, the wizard that creates a project and the flow that adds DataTug to an existing GitHub repository.
Every screen is an Elm-style nav.Screen. Work that touches the disk, the network or the keyring is a tea.Cmd returning a result message, and anything that outlives one message (a clone, the GitHub device flow) is a stream: a command that starts the work and a command per progress message. Package variables in seams.go are the only doors to the outside world, so tests replace them instead of starting real processes.
Index ¶
Constants ¶
const ( // PersonalCloudNotice is the line for a personal (no Space) cloud project. PersonalCloudNotice = "Personal DataTug Cloud projects can't be opened in the terminal yet. Move the project to a Space to open it here." // ReadOnlyHint is shown for any edit of a cloud project. ReadOnlyHint = "Edit this project on datatug.app" )
Notices of DataTug Cloud projects.
Variables ¶
var CloudErrorLine = func(err error) string { return err.Error() }
CloudErrorLine is the one-line message for a failed cloud read. The commands package sets it so the UI and the exit lines word errors the same way.
var CloudLoader func(ctx context.Context, ref cloudproject.Ref) (cloudproject.Project, error)
CloudLoader reads a cloud project with the saved login. The commands package sets it; it is nil when the UI runs without one (tests).
Functions ¶
func CreateLocalProject ¶ added in v0.59.0
func CreateLocalProject(projectID, title, location string) (dtconfig.ProjectRef, error)
CreateLocalProject is the writer of the "Locally" tab of the create screen: it writes a new project under location and registers it, and returns the registered project. It is exported so that the commands of the CLI can be tested against the project the wizard makes (the two must agree on where a project is).
func IsCloudRef ¶ added in v0.141.0
func IsCloudRef(ref dtconfig.ProjectRef) bool
IsCloudRef reports whether a settings entry is a DataTug Cloud project.
func OpenCloudProject ¶ added in v0.141.0
func OpenCloudProject(p cloudproject.Project, page []string) tea.Cmd
OpenCloudProject returns the command that shows an already loaded cloud project at the section of page and records it as a recent project.
Types ¶
This section is empty.