Documentation
¶
Overview ¶
Package clipboard reads, writes and watches the system clipboard for sharing it between host and client. It carries UTF-8 text and PNG images, skips content that password managers mark as concealed or transient, and never logs what it carries.
Index ¶
Constants ¶
const MaxSize = 16 << 20
MaxSize bounds one item's bytes.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board interface {
// Watch calls onChange for each change another app makes, in canonical
// form (text before an image when both are offered), until ctx ends.
// Content marked concealed or transient is skipped. One watcher at a
// time.
Watch(ctx context.Context, onChange func(Item)) error
// Read returns the current content; ok is false when there is none
// Planck carries, or it is concealed.
Read() (it Item, ok bool, err error)
Write(it Item) error
Close() error
}
Board is the system clipboard.
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard stops clipboard loops between two devices. Each device stamps the items it sends with its own origin; a device drops items from its own origin, does not send back what it just applied, and does not apply what it just sent. It remembers only the last transfer, either way, so content copied again after the other side changed the clipboard still goes out.