share

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 3 Imported by: 0

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

func Share

func Share(ctx context.Context, o Options) error

Share opens the sheet and returns once it's up.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL