Documentation
¶
Overview ¶
Package common provides shared functionality for persistence repositories.
Index ¶
- func ValidatePromptConfig(config *prompt.Config) error
- type BasePromptRepository
- func (r *BasePromptRepository) HasMatchingTaskType(path, taskType string) bool
- func (r *BasePromptRepository) HasValidExtension(path string) bool
- func (r *BasePromptRepository) ListPrompts() ([]string, error)
- func (r *BasePromptRepository) LoadPrompt(taskType string) (*prompt.Config, error)
- func (r *BasePromptRepository) ResolveFilePath(taskType string) (string, error)
- func (r *BasePromptRepository) SearchByContent(taskType string) string
- func (r *BasePromptRepository) SearchByFilename(taskType string) string
- func (r *BasePromptRepository) SearchForPrompt(taskType string) (string, error)
- type UnmarshalFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePromptConfig ¶
ValidatePromptConfig validates the prompt configuration structure
Types ¶
type BasePromptRepository ¶
type BasePromptRepository struct {
BasePath string
TaskTypeToFile map[string]string
Cache map[string]*prompt.Config
Extensions []string
Unmarshal UnmarshalFunc
}
BasePromptRepository provides common prompt repository functionality
func NewBasePromptRepository ¶
func NewBasePromptRepository(basePath string, taskTypeToFile map[string]string, extensions []string, unmarshal UnmarshalFunc) *BasePromptRepository
NewBasePromptRepository creates a new base repository
func (*BasePromptRepository) HasMatchingTaskType ¶
func (r *BasePromptRepository) HasMatchingTaskType(path, taskType string) bool
HasMatchingTaskType checks if a file contains the specified task type
func (*BasePromptRepository) HasValidExtension ¶
func (r *BasePromptRepository) HasValidExtension(path string) bool
HasValidExtension checks if a file has a valid extension
func (*BasePromptRepository) ListPrompts ¶
func (r *BasePromptRepository) ListPrompts() ([]string, error)
ListPrompts returns all available prompt task types
func (*BasePromptRepository) LoadPrompt ¶
func (r *BasePromptRepository) LoadPrompt(taskType string) (*prompt.Config, error)
LoadPrompt loads a prompt configuration by task type
func (*BasePromptRepository) ResolveFilePath ¶
func (r *BasePromptRepository) ResolveFilePath(taskType string) (string, error)
ResolveFilePath finds the file path for a given task type
func (*BasePromptRepository) SearchByContent ¶
func (r *BasePromptRepository) SearchByContent(taskType string) string
SearchByContent searches for files by parsing and checking task type
func (*BasePromptRepository) SearchByFilename ¶
func (r *BasePromptRepository) SearchByFilename(taskType string) string
SearchByFilename searches for files by filename patterns
func (*BasePromptRepository) SearchForPrompt ¶
func (r *BasePromptRepository) SearchForPrompt(taskType string) (string, error)
SearchForPrompt searches for a file matching the task type
type UnmarshalFunc ¶
UnmarshalFunc is a function that unmarshals data into a prompt config