service

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func (service *Service) AddSnippet(abbreviation string, body string) (*snippet.Snippet, error)

AddSnippet adds a Snippet via the dbus service.

func (*Service) CopySnippet

func (service *Service) CopySnippet(abbreviation string, skipLastUsed bool) error

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

func (service *Service) GetAutoexpandStatus() (bool, error)

GetAutoexpandStatus to see whether it is turned on.

func (*Service) GetAutostartStatus

func (service *Service) GetAutostartStatus() (bool, error)

GetAutostartStatus to see whether it is turned on.

func (*Service) GetSetting

func (service *Service) GetSetting(key string) (string, error)

GetSetting gets a setting for a given key.

func (*Service) GetSnippetWithAbbreviation

func (service *Service) GetSnippetWithAbbreviation(abbreviation string) (*snippet.Snippet, error)

GetSnippetWithAbbreviation for a given abbreviation.

func (*Service) GetSnippetWithID

func (service *Service) GetSnippetWithID(id string) (*snippet.Snippet, error)

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

func (service *Service) PasteSnippet(abbreviation string, useShiftKey bool, delay int64) error

PasteSnippet asks the daemon to paste a snippet after a number of milliseconds.

func (*Service) Ping

func (service *Service) Ping(expected string) (string, error)

Ping expects pong or another supplied response from the dbus service.

func (*Service) RemoveSnippet

func (service *Service) RemoveSnippet(abbreviation string) (bool, error)

RemoveSnippet removes a Snippet via the dbus service.

func (*Service) SaveSetting

func (service *Service) SaveSetting(key string, value string) error

SaveSetting saves a setting for the given key and value, empty value returns setting to its default.

func (*Service) Stop

func (service *Service) Stop() error

Stop daemon.

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

func (service *Service) UpdateAutoexpand(on bool) error

UpdateAutoexpand to turn it on or off.

func (*Service) UpdateAutostart

func (service *Service) UpdateAutostart(on bool) error

UpdateAutostart to turn it on or off.

func (*Service) UpdateSnippetWithID

func (service *Service) UpdateSnippetWithID(id uuid.UUID, snippet *snippet.Snippet) error

UpdateSnippetWithID updates a Snippet via the dbus service.

Jump to

Keyboard shortcuts

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