Documentation ¶
Index ¶
- func NewDBusService() (*dbus.Conn, dbusservice.DBusService, error)
- type Service
- func (service *Service) AddSnippet(abbreviation string, body string) (*snippet.Snippet, error)
- func (service *Service) CopySnippet(abbreviation string, skipLastUsed bool) error
- func (service *Service) ExpandAbbreviation(abbreviation string, skipLastUsed bool) (dbusservice.ExpandAbbreviationResult, error)
- func (service *Service) GetAutoexpandStatus() (bool, error)
- func (service *Service) GetAutostartStatus() (bool, error)
- func (service *Service) GetSetting(key string) (string, error)
- func (service *Service) GetSnippetWithAbbreviation(abbreviation string) (*snippet.Snippet, error)
- func (service *Service) GetSnippetWithID(id string) (*snippet.Snippet, error)
- func (service *Service) GetSnippets(search string, orderByLastUsed bool) ([]*snippet.Snippet, error)
- func (service *Service) PasteSnippet(abbreviation string, useShiftKey bool, delay int64) error
- func (service *Service) Ping(expected string) (string, error)
- func (service *Service) RemoveSnippet(abbreviation string) (bool, error)
- func (service *Service) SaveSetting(key string, value string) error
- func (service *Service) Stop() error
- func (service *Service) SyncSnippets(snippets []*snippet.Snippet, options dbusservice.SyncOptions) (dbusservice.SyncResult, error)
- func (service *Service) UpdateAutoexpand(on bool) error
- func (service *Service) UpdateAutostart(on bool) error
- func (service *Service) UpdateSnippetWithID(id uuid.UUID, snippet *snippet.Snippet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDBusService ¶
func NewDBusService() (*dbus.Conn, dbusservice.DBusService, error)
NewDBusService starts the dbus service with given config.
Types ¶
type Service ¶
type Service struct {
dbus.BusObject
}
func (*Service) AddSnippet ¶
AddSnippet adds a Snippet via the dbus service.
func (*Service) CopySnippet ¶
CopySnippet asks the daemon to copy an expanded snippet into the pasteboard.
func (*Service) ExpandAbbreviation ¶
func (service *Service) ExpandAbbreviation(abbreviation string, skipLastUsed bool) (dbusservice.ExpandAbbreviationResult, error)
ExpandAbbreviation returns the body with expanded placeholders as well as the cursor offset.
func (*Service) GetAutoexpandStatus ¶
GetAutoexpandStatus to see whether it is turned on.
func (*Service) GetAutostartStatus ¶
GetAutostartStatus to see whether it is turned on.
func (*Service) GetSetting ¶
GetSetting gets a setting for a given key.
func (*Service) GetSnippetWithAbbreviation ¶
GetSnippetWithAbbreviation for a given abbreviation.
func (*Service) GetSnippetWithID ¶
GetSnippetWithID for a given ID.
func (*Service) GetSnippets ¶
func (service *Service) GetSnippets(search string, orderByLastUsed bool) ([]*snippet.Snippet, error)
GetSnippets gets a list of snippets that optionally include the search string in their abbreviation or body.
func (*Service) PasteSnippet ¶
PasteSnippet asks the daemon to paste a snippet after a number of milliseconds.
func (*Service) RemoveSnippet ¶
RemoveSnippet removes a Snippet via the dbus service.
func (*Service) SaveSetting ¶
SaveSetting saves a setting for the given key and value, empty value returns setting to its default.
func (*Service) SyncSnippets ¶
func (service *Service) SyncSnippets(snippets []*snippet.Snippet, options dbusservice.SyncOptions) (dbusservice.SyncResult, error)
SyncSnippets in database with options to handle clashes.
func (*Service) UpdateAutoexpand ¶
UpdateAutoexpand to turn it on or off.
func (*Service) UpdateAutostart ¶
UpdateAutostart to turn it on or off.