keybinds

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDiscoverProviders

func AutoDiscoverProviders(registry *Registry, config *DiscoveryConfig) error

func List

func List() []string

func Register

func Register(provider Provider) error

func SetJSONProviderFactory

func SetJSONProviderFactory(factory JSONProviderFactory)

Types

type CheatSheet

type CheatSheet struct {
	Title    string               `json:"title"`
	Provider string               `json:"provider"`
	Binds    map[string][]Keybind `json:"binds"`
}

type DiscoveryConfig

type DiscoveryConfig struct {
	SearchPaths []string
}

func DefaultDiscoveryConfig

func DefaultDiscoveryConfig() *DiscoveryConfig

func (*DiscoveryConfig) FindJSONFiles

func (d *DiscoveryConfig) FindJSONFiles() ([]string, error)

type JSONProviderFactory

type JSONProviderFactory func(filePath string) (Provider, error)

type Keybind

type Keybind struct {
	Key         string `json:"key"`
	Description string `json:"desc"`
	Subcategory string `json:"subcat,omitempty"`
}

type Provider

type Provider interface {
	Name() string
	GetCheatSheet() (*CheatSheet, error)
}

func Get

func Get(name string) (Provider, error)

type Registry

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

func GetDefaultRegistry

func GetDefaultRegistry() *Registry

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Provider, error)

func (*Registry) List

func (r *Registry) List() []string

func (*Registry) Register

func (r *Registry) Register(provider Provider) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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