Documentation ¶
Index ¶
- Constants
- type Manager
- func (m *Manager) AddSetting(tx *sql.Tx, key string, value string) error
- func (m *Manager) AddSnippet(tx *sql.Tx, abbreviation string, body string) (*snippet.Snippet, error)
- func (m *Manager) CopySnippet(abbreviation string, skipLastUsed bool) error
- func (m *Manager) GetExpandedBodyForAbbreviation(abbreviation string, skipLastUsed bool) (body string, cursorOffset int, err error)
- func (m *Manager) GetSetting(tx *sql.Tx, key string) (string, error)
- func (m *Manager) GetSnippetWithAbbreviation(abbreviation string) (*snippet.Snippet, error)
- func (m *Manager) GetSnippetWithID(id uuid.UUID) (*snippet.Snippet, error)
- func (m *Manager) GetSnippets(search string, orderByLastUsed bool) ([]*snippet.Snippet, error)
- func (m *Manager) GetSnippetsEndingWithAbbreviation(abbreviation string) ([]*snippet.Snippet, error)
- func (m *Manager) InsertSnippet(tx *sql.Tx, snippet *snippet.Snippet) (*snippet.Snippet, error)
- func (m *Manager) RemoveSetting(tx *sql.Tx, key string) error
- func (m *Manager) RemoveSnippetWithID(tx *sql.Tx, id uuid.UUID) error
- func (m *Manager) UpdateLastUsedForAbbreviation(abbreviation string) error
- func (m *Manager) UpdateSetting(tx *sql.Tx, key string, value string) (int64, error)
- func (m *Manager) UpdateSnippetWithID(tx *sql.Tx, id uuid.UUID, snippet *snippet.Snippet) error
Constants ¶
const PlaceholderDelimiter = "$$"
const PlaceholderDelimiterEscaped = `$\$`
const PlaceholderMacro = "@"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) AddSetting ¶
AddSetting creates a new setting with given key and value.
func (*Manager) AddSnippet ¶
func (m *Manager) AddSnippet(tx *sql.Tx, abbreviation string, body string) (*snippet.Snippet, error)
AddSnippet creates a new Snippet with a unique ID.
func (*Manager) CopySnippet ¶
CopySnippet copies an expanded snippet into the clipboard.
func (*Manager) GetExpandedBodyForAbbreviation ¶
func (m *Manager) GetExpandedBodyForAbbreviation(abbreviation string, skipLastUsed bool) (body string, cursorOffset int, err error)
GetExpandedBodyForAbbreviation expands placeholders in returned body along with cursor offset.
func (*Manager) GetSetting ¶
GetSetting returns a setting value for a given key.
func (*Manager) GetSnippetWithAbbreviation ¶
GetSnippetWithAbbreviation for a given abbreviation.
func (*Manager) GetSnippetWithID ¶
GetSnippetWithID for a given ID.
func (*Manager) GetSnippets ¶
GetSnippets returns all Snippets where their abbreviation or body includes given search string.
func (*Manager) GetSnippetsEndingWithAbbreviation ¶
func (m *Manager) GetSnippetsEndingWithAbbreviation(abbreviation string) ([]*snippet.Snippet, error)
GetSnippetsEndingWithAbbreviation returns all Snippets that end with given abbreviation fragment.
func (*Manager) InsertSnippet ¶
InsertSnippet saves a Snippet, with generated ID if not set.
func (*Manager) RemoveSetting ¶
RemoveSetting removes a setting with given key.
func (*Manager) RemoveSnippetWithID ¶
RemoveSnippetWithID deletes a snippet given its ID.
func (*Manager) UpdateLastUsedForAbbreviation ¶
UpdateLastUsedForAbbreviation sets the associated snippets last used datetime to now.
func (*Manager) UpdateSetting ¶
UpdateSetting updates a setting with the given key and value, and returns how many records were updated.