Documentation ¶
Overview ¶
Package clipboard provide a simple clipboard read and write operations.
Index ¶
- Constants
- func Available() bool
- func GetReaderBin() string
- func GetWriterBin() string
- func ReadString() (string, error)
- func Reset() error
- func WriteString(s string) error
- type Clipboard
- func (c *Clipboard) Available() bool
- func (c *Clipboard) Flush() error
- func (c *Clipboard) Read() ([]byte, error)
- func (c *Clipboard) ReadString() (string, error)
- func (c *Clipboard) ReadToFile(filepath string) error
- func (c *Clipboard) Reset() error
- func (c *Clipboard) Write(p []byte) (int, error)
- func (c *Clipboard) WriteFromFile(filepath string) error
- func (c *Clipboard) WriteString(s string) (int, error)
Constants ¶
View Source
const ( WriterOnMac = "pbcopy" WriterOnWin = "clip" // clip only support write contents to clipboard. WriterOnLin = "xsel" ReaderOnMac = "pbpaste" ReaderOnWin = "powershell get-clipboard" // read should use: powershell get-clipboard ReaderOnLin = "xclip" )
clipboard writer, reader program names
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clipboard ¶
type Clipboard struct {
// contains filtered or unexported fields
}
Clipboard struct
func (*Clipboard) ReadString ¶
ReadString contents as string from clipboard
func (*Clipboard) ReadToFile ¶
ReadToFile dump clipboard data to file
func (*Clipboard) WriteFromFile ¶
WriteFromFile contents to clipboard
Click to show internal directories.
Click to hide internal directories.