recon

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeMapping

func AttributeMapping(attributes map[string]interface{}, contextMapping []types.FieldMapping) map[string]string

func SaveOptions

func SaveOptions(providerName string, options []Option) error

Types

type Column

type Column struct {
	Key    string
	Name   string
	Hidden bool
}

func DefaultColumns

func DefaultColumns() []Column

type Module

type Module interface {
	Name() string                                    // Name returns the name of the module
	Type() string                                    // Type returns the type of the module
	Options() ([]Option, error)                      // Options returns the options
	OptionsOrCache(maxAge float64) ([]Option, error) // OptionsOrCache returns the options from cache or calls Options
	SelectOption(options *Option) error              // Select can be used to run actions / enrich the context before opening the session
	Columns() []Column                               // Columns returns the columns for a tabular view
}

type Option

type Option struct {
	ProviderName   string            `json:"provider_name"`   // module name
	ProviderType   string            `json:"provider_type"`   // module type
	Id             string            `json:"id"`              // unique id
	DisplayName    string            `json:"display_name"`    // display name for the fuzzy finder
	Name           string            `json:"name"`            // name
	Description    string            `json:"description"`     // description
	Web            string            `json:"web"`             // web url
	StartDirectory string            `json:"start_directory"` // sets the initial working directory
	Tags           []string          `json:"tags"`            // tags
	Context        map[string]string `json:"context"`         // additional context information
	ModuleContext  map[string]string `json:"module_context"`  // internal context information, not exposed to the user
}

func LoadOptions

func LoadOptions(providerName string, maxAge float64) ([]Option, error)

func OptionById

func OptionById(options []Option, id string) (*Option, error)

func OptionsOrCache

func OptionsOrCache(p Module, maxAge float64) ([]Option, error)

func (*Option) CreateStartDirectoryIfMissing

func (o *Option) CreateStartDirectoryIfMissing() error

func (*Option) ProcessUserTemplateStrings added in v0.8.1

func (o *Option) ProcessUserTemplateStrings(displayNameTemplate string, startDirectoryTemplate string)

func (*Option) RenderPreview

func (o *Option) RenderPreview() string

func (*Option) ResolvePlaceholders

func (o *Option) ResolvePlaceholders(input string) string

func (*Option) ResolveStartDirectory

func (o *Option) ResolveStartDirectory(full bool) string

type OptionsCache

type OptionsCache struct {
	ProviderName string
	Options      []Option
	CreatedAt    time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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