Help us shape the future of Go! Take the 2026 Go Developer Survey

importerapi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportOptions

type ImportOptions struct {
	// Required, editor type
	EditorType pluginapi.EditorType
	// Required, input stream, contains the keymap config for different editors
	InputStream io.Reader
	// Optional, existing onekeymap base setting
	Base keymap.Keymap
}

ImportOptions provides configuration for an import operation.

type ImportResult

type ImportResult struct {
	// The converted keymap setting.
	Setting keymap.Keymap
	// Any issues that arose during the import process.
	Report *validateapi.ValidationReport

	// The changes to the keymap setting.
	Changes *KeymapChanges

	SkipReport pluginapi.ImportSkipReport
}

ImportResult represents the result of an import operation.

type Importer

type Importer interface {
	// Import converts keymaps from a source stream. It returns the converted
	// settings and a report detailing any conflicts or unmapped actions.
	Import(ctx context.Context, opts ImportOptions) (*ImportResult, error)
}

Importer defines the interface for the import service, which handles the conversion of editor-specific keymaps into the universal format.

type KeymapChanges

type KeymapChanges struct {
	// The keymaps that are added.
	Add []keymap.Action
	// The keymaps that are removed.
	Remove []keymap.Action
	// The keymaps that are updated.
	Update []KeymapDiff
}

KeymapChanges represents the changes to a keymap setting.

type KeymapDiff

type KeymapDiff struct {
	Before keymap.Action
	After  keymap.Action
}

Jump to

Keyboard shortcuts

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