Documentation ¶
Overview ¶
Package tui provides a BubbleTea powered tui for Deploystack. All rendering should happen within this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorCustomNotValidPhoneNumber = fmt.Errorf("not a valid phone number")
ErrorCustomNotValidPhoneNumber is the error you get when you fail phone number validation.
Functions ¶
func Fatal ¶
func Fatal(err error)
Fatal stops processing of Deploystack and halts the calling process. All with an eye towards not processing in the shell script of things go wrong.
func GetMock ¶
func GetMock(delay int) mock
GetMock returns a mock gcloud.Client from github.com/GoogleCloudPlatform/deploystack/gcloud
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents the flow of the application from screen to screen, or a the developer level tea.Model to tea.Model. It allows for progression and even going back through the queue all to manage the population of a deploystack setting and tfvars file
func (*Queue) InitializeUI ¶
func (q *Queue) InitializeUI()
InitializeUI spins up everything we need to have a working queue in the hosting application
func (*Queue) Model ¶
func (q *Queue) Model(key string) QueueModel
Model retrieves a give model by key from the queue
func (*Queue) ProcessConfig ¶
ProcessConfig does the work of turning a DeployStack config file to a set of tui screens. It's separate from Initialize in case we want to be able to populate setting and variables with other information before running the genreation of those screens
func (*Queue) Save ¶
Save stores a value in a simple cache for communicating between operations in the same process
func (*Queue) Start ¶
func (q *Queue) Start() QueueModel
Start returns the first model to the hosting application so that it can be run through tea.NewProgram
type QueueModel ¶
QueueModel is an extented version of tea.Model modified to work with the queue system
type UIClient ¶
type UIClient interface { ProjectIDGet() (string, error) ProjectList() ([]gcloud.ProjectWithBilling, error) ProjectParentGet(project string) (*cloudresourcemanager.ResourceId, error) ProjectCreate(project, parent, parentType string) error ProjectNumberGet(id string) (string, error) ProjectIDSet(id string) error RegionList(project, product string) ([]string, error) ZoneList(project, region string) ([]string, error) DomainIsAvailable(project, domain string) (*domainspb.RegisterParameters, error) DomainIsVerified(project, domain string) (bool, error) DomainRegister(project string, domaininfo *domainspb.RegisterParameters, contact gcloud.ContactData) error ImageLatestGet(project, imageproject, imagefamily string) (string, error) MachineTypeList(project, zone string) (*compute.MachineTypeList, error) MachineTypeFamilyList(imgs *compute.MachineTypeList) gcloud.LabeledValues MachineTypeListByFamily(imgs *compute.MachineTypeList, family string) gcloud.LabeledValues ImageList(project, imageproject string) (*compute.ImageList, error) ImageTypeListByFamily(imgs *compute.ImageList, project, family string) gcloud.LabeledValues ImageFamilyList(imgs *compute.ImageList) gcloud.LabeledValues BillingAccountList() ([]*cloudbilling.BillingAccount, error) BillingAccountAttach(project, account string) error }
UIClient interface encapsulates all of the calls to gcloud that one needs to make the TUI work