strategy

package
v1.4.499 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultStrategiesGitRepoFolder = "data/strategies"
View Source
const DefaultStrategiesGitRepoUrl = "https://github.com/danielmiessler/fabric.git"

Variables

This section is empty.

Functions

func LoadAllFiles

func LoadAllFiles() (strategies map[string]Strategy, err error)

Types

type StrategiesManager

type StrategiesManager struct {
	*plugins.PluginBase
	Strategies map[string]Strategy

	DefaultGitRepoUrl *plugins.SetupQuestion
	DefaultFolder     *plugins.SetupQuestion
}

func NewStrategiesManager

func NewStrategiesManager() (sm *StrategiesManager)

func (*StrategiesManager) IsConfigured

func (sm *StrategiesManager) IsConfigured() (ret bool)

func (*StrategiesManager) ListStrategies

func (sm *StrategiesManager) ListStrategies(shellCompleteList bool) error

ListStrategies prints available strategies

func (*StrategiesManager) PopulateDB

func (sm *StrategiesManager) PopulateDB() (err error)

PopulateDB downloads strategies from the internet and populates the strategies folder

func (*StrategiesManager) Setup

func (sm *StrategiesManager) Setup() (err error)

type Strategy

type Strategy struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Prompt      string `json:"prompt"`
}

func LoadStrategy

func LoadStrategy(filename string) (*Strategy, error)

LoadStrategy loads a strategy from the given name. The resolved path is validated to stay within the strategy directory to prevent path traversal.

Jump to

Keyboard shortcuts

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