Documentation
¶
Overview ¶
Package share opens the system's share sheet.
nimbus native plugin add share
share.Share(ctx, share.Options{Text: "Table for two at 8", URL: "https://example.com/b/42"})
share.Share(ctx, share.Options{Files: []share.File{{Name: "receipt.pdf", Type: "application/pdf", Data: pdf}}})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Name string `json:"name"` // its file name
Type string `json:"type"` // a MIME type, such as "image/jpeg"
Data []byte `json:"data"` // its contents
}
File is a file to share, as bytes.
type Options ¶
type Options struct {
Title string `json:"title,omitempty"` // Android's chooser title, and a subject in mail
Text string `json:"text,omitempty"` // text to share
URL string `json:"url,omitempty"` // a link to share
Files []File `json:"files,omitempty"` // files to share
}
Options is what to share; set at least one.
Click to show internal directories.
Click to hide internal directories.