Documentation
¶
Index ¶
- func DefaultFilepath() (string, error)
- func DeleteRefreshToken() error
- func GetGCloudProjects(ctx context.Context) (projects []*cloudresourcemanager.Project, err error)
- func GetRefreshToken() (string, error)
- func GoogleAuthCommand() *cli.Command
- func NewServiceAccountsUI(store Store, serviceAccounts []ServiceAccountDbo) (tea.Model, error)
- func StartInteractiveLogin(ctx context.Context, scopes []string) (*oauth2.Token, error)
- type AddServiceAccountCanceledMsg
- type AddServiceAccountSubmittedMsg
- type FileStore
- type ServiceAccountDbo
- type ServiceAccountsUpdatedMsg
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFilepath ¶
DefaultFilepath returns a default config path for this application. On Unix-like systems: $XDG_CONFIG_HOME/firestore-viewer/service_accounts.json On macOS: ~/Library/Application Support/firestore-viewer/service_accounts.json On Windows: %AppData%/firestore-viewer/service_accounts.json
func DeleteRefreshToken ¶
func DeleteRefreshToken() error
DeleteRefreshToken removes the stored refresh token from the keychain
func GetGCloudProjects ¶
func GetGCloudProjects(ctx context.Context) (projects []*cloudresourcemanager.Project, err error)
func GetRefreshToken ¶
GetRefreshToken retrieves a stored token from the keychain
func GoogleAuthCommand ¶
func NewServiceAccountsUI ¶
func NewServiceAccountsUI(store Store, serviceAccounts []ServiceAccountDbo) (tea.Model, error)
Types ¶
type AddServiceAccountCanceledMsg ¶
type AddServiceAccountCanceledMsg struct{}
AddServiceAccountCanceledMsg is emitted when the user cancels the form.
type AddServiceAccountSubmittedMsg ¶
type AddServiceAccountSubmittedMsg struct{ Account ServiceAccountDbo }
AddServiceAccountSubmittedMsg is emitted by the form when user confirms submission. The payload is the validated ServiceAccountDbo to be persisted by a parent model. It is defined in this file to keep coupling low.
type FileStore ¶
type FileStore struct {
// Filepath is the full path to the JSON file.
Filepath string
}
func (FileStore) Load ¶
func (s FileStore) Load() ([]ServiceAccountDbo, error)
Load implements Store.Load.
func (FileStore) Save ¶
func (s FileStore) Save(list []ServiceAccountDbo) error
Save implements Store.Save.
type ServiceAccountDbo ¶
func (ServiceAccountDbo) Validate ¶
func (sa ServiceAccountDbo) Validate() error
Validate implements the interface { Validate() error } required by the project.
type ServiceAccountsUpdatedMsg ¶
type ServiceAccountsUpdatedMsg []ServiceAccountDbo
ServiceAccountsUpdatedMsg is emitted by fbauth UIs to notify parent models that the list of service accounts has changed. Payload is the full, current list.
type Store ¶
type Store interface {
// Load returns the list of service accounts and optional active index/name if needed later.
Load() ([]ServiceAccountDbo, error)
// Save persists the list of service accounts.
Save([]ServiceAccountDbo) error
}