Documentation ¶
Index ¶
- type Autofocused
- type ConfirmationModal
- type Controlled
- type CreateKeyModal
- type DecryptAndVerifyModal
- type DownloadOrViewModal
- type EmptyState
- type EncryptAndSignModal
- type ErrorModal
- type ExportKeyModal
- type FileUpload
- type Home
- type ImportKeyModal
- type KeyList
- type Modal
- type Navbar
- type PGPKey
- type PasswordModal
- type SingleActionModal
- type TextOutputModal
- type TextOutputModalTab
- type Toolbar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Autofocused ¶
type Autofocused struct { app.Compo Disable bool // Disable the focus Component app.UI // The component to be focused }
Autofocused calls `focus` on the encapsulated component after it is mounted
func (*Autofocused) OnMount ¶
func (c *Autofocused) OnMount(ctx app.Context)
func (*Autofocused) Render ¶
func (c *Autofocused) Render() app.UI
type ConfirmationModal ¶
type ConfirmationModal struct { app.Compo ID string // HTML ID of the modal; must be unique across the page Icon string // Class of the icon to use to the left of the title; may be empty Title string // Title of the modal Class string // Class to be applied to the modal's outmost component Body string // Body text of the modal ActionClass string // Class to be applied to the modal's primary action ActionLabel string // Text to display on the modal's primary action CancelLabel string // Text to display on the modal's cancel action CancelLink string // Link to display as the cancel action; if empty, `OnClose` is being called OnClose func() // Handler to call when closing/cancelling the modal OnAction func() // Handler to call when triggering the modal's primary action }
ConfirmationModal is a modal with callbacks intended to enable confirm destructive operations such as deleting something
func (*ConfirmationModal) Render ¶
func (c *ConfirmationModal) Render() app.UI
type Controlled ¶
type Controlled struct { app.Compo Component app.UI // The component to be focused Properties map[string]interface{} // Map of properties to set }
Controlled sets DOM properties of the encapsulated component after it is mounted
func (*Controlled) OnUpdate ¶
func (c *Controlled) OnUpdate(ctx app.Context)
func (*Controlled) Render ¶
func (c *Controlled) Render() app.UI
type CreateKeyModal ¶
type CreateKeyModal struct { app.Compo OnSubmit func( fullName string, email string, password string, ) // Handler to call to create the key OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
CreateKeyModal is a modal which provides the information needed to create a key
func (*CreateKeyModal) Render ¶
func (c *CreateKeyModal) Render() app.UI
type DecryptAndVerifyModal ¶
type DecryptAndVerifyModal struct { app.Compo Keys []PGPKey // PGP keys to be available for decryption/verification OnSubmit func( file []byte, publicKeyID string, privateKeyID string, detachedSignature []byte, ) // Handler to call to decrypt/verify OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
DecryptAndVerifyModal is a modal to provide the information needed to decrypt/verify something
func (*DecryptAndVerifyModal) Render ¶
func (c *DecryptAndVerifyModal) Render() app.UI
type DownloadOrViewModal ¶
type DownloadOrViewModal struct { app.Compo SubjectA bool // Whether to display the first subject to download or view SubjectANoun string // Noun form the first subject to download or view (i.e. "signature") SubjectAAdjective string // Adjective of the first subject to download or view (i.e. "signed") SubjectB bool // Whether to display the second subject to download or view SubjectBNoun string // Noun form the second subject to download or view (i.e. "signature") SubjectBAdjective string // Adjective of the second subject to download or view (i.e. "signed") OnClose func(used bool) // Handler to call when closing/cancelling the modal OnDownload func() // Handler to call to download the subject(s) OnView func() // Handler to view to download the subject(s) ShowView bool // Whether to show the view action // contains filtered or unexported fields }
DownloadOrViewModal is a modal which provides the actions needed to download or view text
func (*DownloadOrViewModal) Render ¶
func (c *DownloadOrViewModal) Render() app.UI
type EmptyState ¶
type EmptyState struct { app.Compo OnCreateKey func() // OnCreateKey is the handler to call to create a key OnImportKey func() // OnCreateKey is the handler to call to import a key }
EmptyState is the initial placeholder of the key list
func (*EmptyState) Render ¶
func (c *EmptyState) Render() app.UI
type EncryptAndSignModal ¶
type EncryptAndSignModal struct { app.Compo Keys []PGPKey // PGP keys to be available for encryption/signing OnSubmit func( file []byte, publicKeyID string, privateKeyID string, createDetachedSignature bool, armor bool, ) // Handle to call to encrypt/sign OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
EncryptAndSignModal is a modal which provides the information needed to encrypt/sign something
func (*EncryptAndSignModal) Render ¶
func (c *EncryptAndSignModal) Render() app.UI
type ErrorModal ¶
type ErrorModal struct { app.Compo ID string // HTML ID of the modal; must be unique across the page Icon string // Class of the icon to use to the left of the title; may be empty Title string // Title of the modal Class string // Class to be applied to the modal's outmost component Body string // Body text of the modal Error error // The error display (must not be nil) ActionLabel string // Text to display on the modal's primary action OnClose func() // Handler to call when closing/cancelling the modal OnAction func() // Handler to call when triggering the modal's primary action }
ErrorModal is a modal to display an error
func (*ErrorModal) Render ¶
func (c *ErrorModal) Render() app.UI
type ExportKeyModal ¶
type ExportKeyModal struct { app.Compo PublicKey bool // Whether to display the options for a public key OnDownloadPublicKey func(armor, base64encode bool) // Handler to call to download the public key OnViewPublicKey func(armor, base64encode bool) // Handler to call to view the public key PrivateKey bool // Whether to display the options for a private key OnDownloadPrivateKey func(armor, base64encode bool) // Handler to call to download the private key OnViewPrivateKey func(armor, base64encode bool) // Handler to call to view the private key OnOK func() // Handler to call when dismissing the modal // contains filtered or unexported fields }
ExportKeyModal is a modal which provides the actions needed to export a key
func (*ExportKeyModal) Render ¶
func (c *ExportKeyModal) Render() app.UI
type FileUpload ¶
type FileUpload struct { app.Compo ID string // HTML ID of the modal; must be unique across the page FileSelectionLabel string // Text to display on the file selection input ClearLabel string // Text to display on the clear action TextEntryInputPlaceholder string // Placeholder to display in the text input field TextEntryInputBlockedLabel string // Text to display in the input if it is blocked (i.e. because a file has been selected) FileContents []byte // Contents of the file selected/text entered OnChange func(fileContents []byte) // Handler to call to set `FileContents` OnClear func() // Handler to call to clear `FileContents` // contains filtered or unexported fields }
FileUpload provides a way to upload/import a file by entering it's contents or selecting it
func (*FileUpload) Render ¶
func (c *FileUpload) Render() app.UI
type Home ¶
Home is the home page
func (*Home) OnAppUpdate ¶
func (*Home) OnDismount ¶
func (c *Home) OnDismount()
type ImportKeyModal ¶
type ImportKeyModal struct { app.Compo OnSubmit func(key []byte) // Handler to call to import the key OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
ImportKeyModal is a modal to import keys with
func (*ImportKeyModal) Render ¶
func (c *ImportKeyModal) Render() app.UI
type KeyList ¶
type KeyList struct { app.Compo Keys []PGPKey // PGP keys to list OnExport func(keyID string) // Handler to call to export a PGP key OnDelete func(keyID string) // Handler to call to delete a PGP key // contains filtered or unexported fields }
KeyList is a list of PGP keys
func (*KeyList) OnDismount ¶
func (c *KeyList) OnDismount()
type Modal ¶
type Modal struct { app.Compo ID string // HTML ID of the modal; must be unique across the page Icon string // Class of the icon to use to the left of the title; may be empty Title string // Title of the modal Class string // Class to be applied to the modal's outmost component Body []app.UI // Body of the modal DisableFocus bool // Disable auto-focusing the modal; useful if a child component, i.e. an input should be focused instead OnClose func() // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
Modal is a generic modal with a close handler
func (*Modal) OnDismount ¶
func (c *Modal) OnDismount()
type PGPKey ¶ added in v0.1.1
type PGPKey struct { ID string `json:"id"` // Internal unique ID of the PGP key, i.e. it's fingerprint Label string `json:"label"` // Displayable ID of the PGP key FullName string `json:"fullName"` // Full name of the PGP key's holder Email string `json:"email"` // Email of the PGP key's holder Private bool `json:"private"` // Whether the PGP key is private Public bool `json:"public"` // Whether the PGP key is public Content []byte `json:"content"` // Raw PGP key (Potentially protected or armored) }
PGPKey is a PGP key an it's metadata
type PasswordModal ¶
type PasswordModal struct { app.Compo Title string // Title of the modal WrongPassword bool // Whether the previously entered password was wrong ClearWrongPassword func() // Handler to call when clearing the password OnSubmit func(password string) // Handler to call to submit the password OnCancel func() // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
PasswordModal is a modal which allows to user to enter a password
func (*PasswordModal) Render ¶
func (c *PasswordModal) Render() app.UI
type SingleActionModal ¶
type SingleActionModal struct { app.Compo ID string // HTML ID of the modal; must be unique across the page Icon string // Class of the icon to use to the left of the title; may be empty Title string // Title of the modal Class string // Class to be applied to the modal's outmost component Body string // Body text of the modal ActionLabel string // Text to display on the modal's primary action OnClose func() // Handler to call when closing/cancelling the modal OnAction func() // Handler to call when triggering the modal's primary action }
SingleActionModal is a modal which has only a singular action
func (*SingleActionModal) Render ¶
func (c *SingleActionModal) Render() app.UI
type TextOutputModal ¶
type TextOutputModal struct { app.Compo Title string // Title of the modal Tabs []TextOutputModalTab // Tabs to be displayed OnClose func() // Handler to call when closing/cancelling the modal // contains filtered or unexported fields }
TextOutputModal is a modal to display multiple text snippets
func (*TextOutputModal) Render ¶
func (c *TextOutputModal) Render() app.UI
type TextOutputModalTab ¶
type TextOutputModalTab struct { Language string // Language of the text to be displayed (i.e. text/plain, French etc.) Title string // Title of the text to be displayed Body string // Text to be displayed }
TextOutputModalTab is a tab which can be displayed in a text output modal
type Toolbar ¶
type Toolbar struct { app.Compo OnCreateKey func() // Handler to call to create a key OnImportKey func() // Handler to call to import a key OnEncryptAndSign func() // Handler to call to encrypt/sign OnDecryptAndVerify func() // Handler to call to decrypt/verify }
Toolbar is the secondary navigation menu and contains most actions
Source Files ¶
- autofocused.go
- confirmation_modal.go
- controlled.go
- create_key_modal.go
- decrypt_and_verify_modal.go
- download_or_view_modal.go
- empty_state.go
- encrypt_and_sign_modal.go
- error_modal.go
- export_key_modal.go
- file_upload.go
- home.go
- import_key_modal.go
- key_list.go
- modal.go
- navbar.go
- password_modal.go
- single_action_modal.go
- text_output_modal.go
- toolbar.go