app

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSnippetsAvailable = errors.New("No snippets are available.")
View Source
var ErrSnippetIDNotFound = errors.New("Snippet with ID not found.")

Functions

This section is empty.

Types

type App

type App interface {
	LookupSnippet() (bool, model.Snippet)
	LookupAndCreatePrintableSnippet() (bool, string)
	LookupSnippetArgs() (bool, string, []model.ParameterValue)
	FindSnippetAndPrint(string, []model.ParameterValue) (bool, string)
	LookupAndExecuteSnippet(bool, bool)
	FindScriptAndExecuteWithParameters(string, []model.ParameterValue, bool, bool)
	ExportSnippets([]ExportField, ExportFormat) string
	GenerateSnippetWithAssistant([]string, time.Duration)
	EnableAssistant()
	Info()
	AddManager()
	SyncManager()
}

func NewApp

func NewApp(options ...Option) App

type ErrMigrateConfig added in v1.4.0

type ErrMigrateConfig struct {
	// contains filtered or unexported fields
}

func (ErrMigrateConfig) Error added in v1.4.0

func (e ErrMigrateConfig) Error() string

func (ErrMigrateConfig) Is added in v1.4.0

func (e ErrMigrateConfig) Is(target error) bool

type ExecutionContext added in v1.8.0

type ExecutionContext int

ExecutionContext indicates the origin of the execution request.

const (
	// ContextDefault represents normal execution (e.g., from lookup).
	ContextDefault ExecutionContext = iota
	// ContextAssistant represents execution initiated from the assistant.
	ContextAssistant
)

type ExportField added in v1.5.0

type ExportField int64
const (
	ExportFieldID         ExportField = 0
	ExportFieldTitle      ExportField = 1
	ExportFieldContent    ExportField = 2
	ExportFieldParameters ExportField = 3
)

type ExportFormat added in v1.5.0

type ExportFormat int64
const (
	ExportFormatJSON       ExportFormat = 0
	ExportFormatPrettyJSON ExportFormat = 1
	ExportFormatXML        ExportFormat = 2
)

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures an App.

func WithAssistantProviderFunc added in v1.6.0

func WithAssistantProviderFunc(providerFunc func(c assistant.Config, d assistant.DemoConfig) assistant.Assistant) Option

WithAssistantProviderFunc sets the assistant provider.

func WithCheckNeedsConfigMigration added in v1.4.0

func WithCheckNeedsConfigMigration(checkNeedsConfigMigration bool) Option

WithCheckNeedsConfigMigration sets if the config file is checked if it is up-to-date.

func WithConfig

func WithConfig(config config.Config) Option

WithConfig sets the config for the App.

func WithConfigService

func WithConfigService(service config.Service) Option

WithConfigService sets the config service for the App.

func WithProvider added in v1.0.0

func WithProvider(builder managers.Provider) Option

WithProvider sets the provider for the list of manager.

func WithTUI added in v1.0.0

func WithTUI(t ui.TUI) Option

WithTUI sets the terminal for the App.

Jump to

Keyboard shortcuts

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