management

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package management provides functionality for managing templates in the LLMreconing Tool.

Package management provides functionality for managing templates in the LLMreconing Tool. It includes components for template loading, parsing, execution, and reporting.

Package management provides functionality for managing templates in the LLMreconing Tool.

Package management provides functionality for managing templates in the LLMreconing Tool.

Package management provides functionality for managing templates.

Package management provides functionality for managing templates in the LLMreconing Tool.

Index

Constants

View Source
const (
	// FileSource indicates the template is from a file
	FileSource = interfaces.FileSource
	// DirectorySource indicates the template is from a directory
	DirectorySource = interfaces.DirectorySource
	// GitHubSource indicates the template is from GitHub
	GitHubSource = interfaces.GitHubSource
	// GitLabSource indicates the template is from GitLab
	GitLabSource = interfaces.GitLabSource
	// HTTPSource indicates the template is from HTTP
	HTTPSource = interfaces.HTTPSource
	// DatabaseSource indicates the template is from a database
	DatabaseSource = interfaces.DatabaseSource
)
View Source
const (
	// StatusLoaded indicates the template has been loaded
	StatusLoaded = interfaces.StatusLoaded
	// StatusValidated indicates the template has been validated
	StatusValidated = interfaces.StatusValidated
	// StatusExecuting indicates the template is being executed
	StatusExecuting = interfaces.StatusExecuting
	// StatusCompleted indicates the template execution has completed
	StatusCompleted = interfaces.StatusCompleted
	// StatusFailed indicates the template execution has failed
	StatusFailed = interfaces.StatusFailed
)
View Source
const OfflineBundleSource = loaders.OfflineBundleSource

OfflineBundleSource is a constant for the offline bundle source

Variables

This section is empty.

Functions

func CreateOfflineBundleRepository

func CreateOfflineBundleRepository(bundlePath string, auditTrail *trail.AuditTrailManager) (*repository.OfflineBundleRepository, error)

CreateOfflineBundleRepository creates a repository for an offline bundle

func DefaultSchemaValidator

func DefaultSchemaValidator(jsonSchemaPath, yamlSchemaPath string) (interfaces.SchemaValidator, error)

DefaultSchemaValidator creates a default schema validator with standard validators

func FindTemplatesByTag

func FindTemplatesByTag(manager *Manager, tag string) []*format.Template

FindTemplatesByTag finds templates by tag

func FindTemplatesByTags

func FindTemplatesByTags(manager *Manager, tags []string) []*format.Template

FindTemplatesByTags finds templates by multiple tags

func GenerateTemplateReport

func GenerateTemplateReport(manager *Manager, results []*TemplateResult, format string) ([]byte, error)

GenerateTemplateReport generates a report for template execution results

func GetTemplateByID

func GetTemplateByID(manager *Manager, id string) (*format.Template, error)

GetTemplateByID gets a template by ID

func ListAllTemplates

func ListAllTemplates(manager *Manager) []*format.Template

ListAllTemplates lists all templates

func RegisterOfflineBundleLoader

func RegisterOfflineBundleLoader(manager *DefaultTemplateManager, auditTrail *trail.AuditTrailManager)

RegisterOfflineBundleLoader registers an offline bundle loader with the template manager

func ValidateCondition

func ValidateCondition(condition interface{}) error

ValidateCondition validates a condition

func ValidateDetectionType

func ValidateDetectionType(detectionType interface{}) error

ValidateDetectionType validates a detection type

func ValidateID

func ValidateID(id interface{}) error

ValidateID validates a template ID

func ValidateSeverity

func ValidateSeverity(severity interface{}) error

ValidateSeverity validates a severity level

func ValidateVersion

func ValidateVersion(version interface{}) error

ValidateVersion validates a version string

Types

type DefaultManagerOptions

type DefaultManagerOptions struct {
	// JSONSchemaPath is the path to the JSON schema file
	JSONSchemaPath string
	// YAMLSchemaPath is the path to the YAML schema file
	YAMLSchemaPath string
	// TemplatePaths is the list of paths to load templates from
	TemplatePaths []string
	// RepositoryConfig is the configuration for the repository manager
	RepositoryConfig *repository.Config
	// CacheTTL is the time-to-live for cached templates
	CacheTTL time.Duration
	// CacheMaxSize is the maximum size of the cache
	CacheMaxSize int
	// ExecutionTimeout is the timeout for template execution
	ExecutionTimeout time.Duration
	// RetryCount is the number of retries for failed requests
	RetryCount int
	// RetryDelay is the delay between retries
	RetryDelay time.Duration
	// MaxConcurrent is the maximum number of concurrent executions
	MaxConcurrent int
	// Providers is the list of LLM providers
	Providers []execution.LLMProvider
	// PreExecutionHooks are functions to run before template execution
	PreExecutionHooks []TemplateHook
	// PostExecutionHooks are functions to run after template execution
	PostExecutionHooks []TemplateHook
}

DefaultManagerOptions contains options for creating a default template manager

func DefaultManagerOptionsWithDefaults

func DefaultManagerOptionsWithDefaults() *DefaultManagerOptions

DefaultManagerOptionsWithDefaults creates default manager options with default values

type DefaultTemplateManager

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

DefaultTemplateManager is the default implementation of TemplateManager

func (*DefaultTemplateManager) Execute

func (m *DefaultTemplateManager) Execute(ctx context.Context, template *format.Template, options map[string]interface{}) (*interfaces.TemplateResult, error)

Execute executes a template

func (*DefaultTemplateManager) ExecuteBatch

func (m *DefaultTemplateManager) ExecuteBatch(ctx context.Context, templates []*format.Template, options map[string]interface{}) ([]*interfaces.TemplateResult, error)

ExecuteBatch executes multiple templates

func (*DefaultTemplateManager) ExecuteTemplate

func (m *DefaultTemplateManager) ExecuteTemplate(ctx context.Context, templateID string, options map[string]interface{}) (*types.TemplateResult, error)

ExecuteTemplate executes a template

func (*DefaultTemplateManager) ExecuteTemplates

func (m *DefaultTemplateManager) ExecuteTemplates(ctx context.Context, templateIDs []string, options map[string]interface{}) ([]*types.TemplateResult, error)

ExecuteTemplates executes multiple templates

func (*DefaultTemplateManager) GenerateReport

func (m *DefaultTemplateManager) GenerateReport(results []*types.TemplateResult, format string) ([]byte, error)

GenerateReport generates a report for template execution results

func (*DefaultTemplateManager) GetCategories

func (m *DefaultTemplateManager) GetCategories() ([]string, error)

GetCategories returns a list of all template categories

func (*DefaultTemplateManager) GetExecutor

GetExecutor returns the template executor

func (*DefaultTemplateManager) GetLoader

GetLoader returns the template loader

func (*DefaultTemplateManager) GetTemplate

func (m *DefaultTemplateManager) GetTemplate(id string) (*format.Template, error)

GetTemplate gets a template by ID

func (*DefaultTemplateManager) GetTemplateInterface

func (m *DefaultTemplateManager) GetTemplateInterface(id string) (Template, error)

GetTemplateInterface wraps GetTemplate to match interface

func (*DefaultTemplateManager) ListTemplates

func (m *DefaultTemplateManager) ListTemplates() []*format.Template

ListTemplates lists all templates

func (*DefaultTemplateManager) ListTemplatesInterface

func (m *DefaultTemplateManager) ListTemplatesInterface() ([]Template, error)

ListTemplatesInterface wraps ListTemplates to match interface

func (*DefaultTemplateManager) LoadFromOfflineBundle

func (m *DefaultTemplateManager) LoadFromOfflineBundle(ctx context.Context, bundlePath string, validationLevel bundle.ValidationLevel) ([]*format.Template, error)

LoadFromOfflineBundle loads templates from an offline bundle

func (*DefaultTemplateManager) LoadTemplate

func (m *DefaultTemplateManager) LoadTemplate(ctx context.Context, source string, sourceType string) (*format.Template, error)

LoadTemplate loads a template from a source

func (*DefaultTemplateManager) LoadTemplateInterface

func (m *DefaultTemplateManager) LoadTemplateInterface(path string) (Template, error)

LoadTemplateInterface wraps LoadTemplate to match interface

func (*DefaultTemplateManager) LoadTemplates

func (m *DefaultTemplateManager) LoadTemplates(ctx context.Context, source string, sourceType string) ([]*format.Template, error)

LoadTemplates loads multiple templates from a source

func (*DefaultTemplateManager) LoadTemplatesFromOfflineBundleRepository

func (m *DefaultTemplateManager) LoadTemplatesFromOfflineBundleRepository(ctx context.Context, repo *repository.OfflineBundleRepository) ([]*format.Template, error)

LoadTemplatesFromOfflineBundleRepository loads templates from an offline bundle repository

func (*DefaultTemplateManager) LoadTemplatesFromSources

func (m *DefaultTemplateManager) LoadTemplatesFromSources(ctx context.Context, sources []types.TemplateSource) error

LoadTemplatesFromSources loads templates from the specified sources

func (*DefaultTemplateManager) ValidateTemplate

func (m *DefaultTemplateManager) ValidateTemplate(template *format.Template) error

ValidateTemplate validates a template

func (*DefaultTemplateManager) ValidateTemplateInterface

func (m *DefaultTemplateManager) ValidateTemplateInterface(template Template) error

ValidateTemplateInterface wraps ValidateTemplate to match interface

type Engine

type Engine interface {
	Execute(ctx context.Context, template Template, target interface{}) (interface{}, error)
	Validate(template Template) error
	GetSupportedFormats() []string
}

Engine represents a template execution engine

type Manager

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

Manager is the implementation of the TemplateManager interface

func CreateDefaultManager

func CreateDefaultManager(ctx context.Context, options *DefaultManagerOptions) (*Manager, error)

CreateDefaultManager creates a default template manager with all components

func NewManager

func NewManager(options *ManagerOptions) (*Manager, error)

NewManager creates a new template manager

func (*Manager) AddHook

func (m *Manager) AddHook(hook TemplateHook, pre bool)

AddHook adds a hook to the template manager

func (*Manager) ClearCache

func (m *Manager) ClearCache()

ClearCache clears the template cache

func (*Manager) ClearHooks

func (m *Manager) ClearHooks()

ClearHooks clears all hooks

func (*Manager) ExecuteTemplate

func (m *Manager) ExecuteTemplate(ctx context.Context, templateID string, options map[string]interface{}) (*TemplateResult, error)

ExecuteTemplate executes a template

func (*Manager) ExecuteTemplates

func (m *Manager) ExecuteTemplates(ctx context.Context, templateIDs []string, options map[string]interface{}) ([]*TemplateResult, error)

ExecuteTemplates executes multiple templates

func (*Manager) FindTemplatesByTag

func (m *Manager) FindTemplatesByTag(tag string) []*format.Template

FindTemplatesByTag finds templates by tag

func (*Manager) FindTemplatesByTags

func (m *Manager) FindTemplatesByTags(tags []string) []*format.Template

FindTemplatesByTags finds templates by multiple tags

func (*Manager) GenerateReport

func (m *Manager) GenerateReport(results []*TemplateResult, format string) ([]byte, error)

GenerateReport generates a report for template execution results

func (*Manager) GetStats

func (m *Manager) GetStats() map[string]interface{}

GetStats gets statistics about the template manager

func (*Manager) GetTemplate

func (m *Manager) GetTemplate(id string) (*format.Template, error)

GetTemplate gets a template by ID

func (*Manager) GetTemplateMetadata

func (m *Manager) GetTemplateMetadata(id string) (map[string]interface{}, error)

GetTemplateMetadata gets metadata for a template

func (*Manager) ListTemplates

func (m *Manager) ListTemplates() []*format.Template

ListTemplates lists all templates

func (*Manager) LoadTemplates

func (m *Manager) LoadTemplates(ctx context.Context, sources []TemplateSource) error

LoadTemplates loads templates from the specified sources

func (*Manager) PruneCache

func (m *Manager) PruneCache(maxAge time.Duration) int

PruneCache removes old entries from the cache

func (*Manager) RegisterTemplate

func (m *Manager) RegisterTemplate(template *format.Template) error

RegisterTemplate registers a template

func (*Manager) RemoveHook

func (m *Manager) RemoveHook(hook TemplateHook, pre bool) bool

RemoveHook removes a hook from the template manager

func (*Manager) SetTemplateMetadata

func (m *Manager) SetTemplateMetadata(id string, metadata map[string]interface{}) error

SetTemplateMetadata sets metadata for a template

func (*Manager) UnregisterTemplate

func (m *Manager) UnregisterTemplate(id string) error

UnregisterTemplate unregisters a template

func (*Manager) UpdateTemplate

func (m *Manager) UpdateTemplate(template *format.Template) error

UpdateTemplate updates a template

func (*Manager) ValidateTemplate

func (m *Manager) ValidateTemplate(template *format.Template) error

ValidateTemplate validates a template

type ManagerConfig

type ManagerConfig struct {
	// CacheTTL is the TTL for cached templates
	CacheTTL time.Duration
	// MaxCacheSize is the maximum number of cached templates
	MaxCacheSize int
	// ConcurrencyLimit is the maximum number of concurrent operations
	ConcurrencyLimit int
	// ExecutionTimeout is the timeout for template execution
	ExecutionTimeout time.Duration
	// LoadTimeout is the timeout for template loading
	LoadTimeout time.Duration
	// RetryCount is the number of retries for failed operations
	RetryCount int
	// RetryDelay is the delay between retries
	RetryDelay time.Duration
	// Debug enables debug logging
	Debug bool
}

ManagerConfig represents configuration for the template manager

type ManagerOptions

type ManagerOptions struct {
	// Loaders is the list of template loaders
	Loaders []interfaces.TemplateLoader
	// Parser is the template parser
	Parser interfaces.TemplateParser
	// Executor is the template executor
	Executor interfaces.TemplateExecutor
	// Reporter is the template reporter
	Reporter interfaces.TemplateReporter
	// Cache is the template cache
	Cache interfaces.TemplateCache
	// Registry is the template registry
	Registry interfaces.TemplateRegistry
	// PreExecutionHooks are functions to run before template execution
	PreExecutionHooks []TemplateHook
	// PostExecutionHooks are functions to run after template execution
	PostExecutionHooks []TemplateHook
}

ManagerOptions contains options for creating a new template manager

type ManagerStats

type ManagerStats struct {
	// TotalTemplates is the total number of templates managed
	TotalTemplates int
	// TotalSources is the total number of sources managed
	TotalSources int
	// TotalLoads is the total number of template loads
	TotalLoads int64
	// TotalExecutions is the total number of template executions
	TotalExecutions int64
	// CacheHitRate is the cache hit rate
	CacheHitRate float64
}

ManagerStats tracks manager statistics

type OptimizedTemplateManager

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

OptimizedTemplateManager is an enhanced template manager with improved performance

func NewOptimizedTemplateManager

func NewOptimizedTemplateManager(config *ManagerConfig) (*OptimizedTemplateManager, error)

NewOptimizedTemplateManager creates a new optimized template manager

func (*OptimizedTemplateManager) AddRepository

func (m *OptimizedTemplateManager) AddRepository(config *repository.Config) error

AddRepository adds a repository to the manager

func (*OptimizedTemplateManager) ClearCache

func (m *OptimizedTemplateManager) ClearCache()

ClearCache clears the template cache

func (*OptimizedTemplateManager) Execute

func (m *OptimizedTemplateManager) Execute(ctx context.Context, template *format.Template, options map[string]interface{}) (*interfaces.TemplateResult, error)

Execute executes a template

func (*OptimizedTemplateManager) ExecuteBatch

func (m *OptimizedTemplateManager) ExecuteBatch(ctx context.Context, templates []*format.Template, options map[string]interface{}) ([]*interfaces.TemplateResult, error)

ExecuteBatch executes multiple templates

func (*OptimizedTemplateManager) GetExecutor

GetExecutor returns the template executor

func (*OptimizedTemplateManager) GetLoader

GetLoader returns the template loader

func (*OptimizedTemplateManager) GetRepositories

func (m *OptimizedTemplateManager) GetRepositories() []repository.Repository

GetRepositories gets all repositories

func (*OptimizedTemplateManager) GetRepository

func (m *OptimizedTemplateManager) GetRepository(name string) (repository.Repository, error)

GetRepository gets a repository by name

func (*OptimizedTemplateManager) GetStats

func (m *OptimizedTemplateManager) GetStats() map[string]interface{}

GetStats returns statistics about the manager

func (*OptimizedTemplateManager) GetTemplateIDs

func (m *OptimizedTemplateManager) GetTemplateIDs() []string

GetTemplateIDs returns all template IDs

func (*OptimizedTemplateManager) GetTemplateStats

func (m *OptimizedTemplateManager) GetTemplateStats(templateID string) map[string]interface{}

GetTemplateStats returns statistics about a specific template

func (*OptimizedTemplateManager) LoadTemplate

func (m *OptimizedTemplateManager) LoadTemplate(ctx context.Context, source string, sourceType string) (*format.Template, error)

LoadTemplate loads a template from a source

func (*OptimizedTemplateManager) LoadTemplates

func (m *OptimizedTemplateManager) LoadTemplates(ctx context.Context, source string, sourceType string) ([]*format.Template, error)

LoadTemplates loads multiple templates from a source

func (*OptimizedTemplateManager) RegisterDetectionEngine

func (m *OptimizedTemplateManager) RegisterDetectionEngine(engine interfaces.DetectionEngine)

RegisterDetectionEngine registers a detection engine

func (*OptimizedTemplateManager) RegisterProvider

func (m *OptimizedTemplateManager) RegisterProvider(provider execution.LLMProvider)

RegisterProvider registers an LLM provider

func (*OptimizedTemplateManager) RemoveRepository

func (m *OptimizedTemplateManager) RemoveRepository(name string) error

RemoveRepository removes a repository by name

func (*OptimizedTemplateManager) SetCacheSize

func (m *OptimizedTemplateManager) SetCacheSize(size int)

SetCacheSize sets the cache size

func (*OptimizedTemplateManager) SetCacheTTL

func (m *OptimizedTemplateManager) SetCacheTTL(ttl time.Duration)

SetCacheTTL sets the cache TTL

func (*OptimizedTemplateManager) SetConcurrencyLimit

func (m *OptimizedTemplateManager) SetConcurrencyLimit(limit int)

SetConcurrencyLimit sets the concurrency limit

func (*OptimizedTemplateManager) SetDebug

func (m *OptimizedTemplateManager) SetDebug(debug bool)

SetDebug sets the debug flag

func (*OptimizedTemplateManager) SetExecutionTimeout

func (m *OptimizedTemplateManager) SetExecutionTimeout(timeout time.Duration)

SetExecutionTimeout sets the execution timeout

func (*OptimizedTemplateManager) SetLoadTimeout

func (m *OptimizedTemplateManager) SetLoadTimeout(timeout time.Duration)

SetLoadTimeout sets the load timeout

type SchemaFormat

type SchemaFormat string

SchemaFormat represents the format of a schema

const (
	// JSONSchema represents a JSON schema
	JSONSchema SchemaFormat = "json"
	// YAMLSchema represents a YAML schema
	YAMLSchema SchemaFormat = "yaml"
)

type SchemaValidator

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

SchemaValidator is responsible for validating templates against a schema

func NewSchemaValidator

func NewSchemaValidator(jsonSchemaPath, yamlSchemaPath string) (*SchemaValidator, error)

NewSchemaValidator creates a new schema validator

func (*SchemaValidator) AddCustomValidator

func (v *SchemaValidator) AddCustomValidator(field string, validator func(interface{}) error)

AddCustomValidator adds a custom validator function for a specific field

func (*SchemaValidator) ValidateJSON

func (v *SchemaValidator) ValidateJSON(data []byte) error

ValidateJSON validates JSON data against the JSON schema

func (*SchemaValidator) ValidateTemplate

func (v *SchemaValidator) ValidateTemplate(template *format.Template) error

ValidateTemplate validates a template against the schema

func (*SchemaValidator) ValidateTemplateFile

func (v *SchemaValidator) ValidateTemplateFile(filePath string) error

ValidateTemplateFile validates a template file against the schema

func (*SchemaValidator) ValidateYAML

func (v *SchemaValidator) ValidateYAML(data []byte) error

ValidateYAML validates YAML data against the YAML schema

type Template

type Template interface {
	GetID() string
	GetName() string
	GetDescription() string
	GetCategory() string
	GetSeverity() string
	GetAuthor() string
	GetVersion() string
	GetTags() []string
	GetReferences() []string
	GetMetadata() map[string]interface{}
	Validate() error
}

Template represents a security test template

type TemplateCache

type TemplateCache interface {
	// Get gets a template from the cache
	Get(id string) (*format.Template, bool)
	// Set sets a template in the cache
	Set(id string, template *format.Template)
	// Delete deletes a template from the cache
	Delete(id string)
	// Clear clears the cache
	Clear()
}

TemplateCache is the interface for caching templates

type TemplateExecutor

type TemplateExecutor interface {
	// Execute executes a template
	Execute(ctx context.Context, template *format.Template, options map[string]interface{}) (*TemplateResult, error)
	// ExecuteBatch executes multiple templates
	ExecuteBatch(ctx context.Context, templates []*format.Template, options map[string]interface{}) ([]*TemplateResult, error)
}

TemplateExecutor is the interface for executing templates

type TemplateHook

type TemplateHook func(ctx context.Context, template *format.Template, result *TemplateResult) error

TemplateHook is a function that runs before or after template execution

type TemplateIndexEntry

type TemplateIndexEntry struct {
	// Source is the source of the template
	Source string
	// SourceType is the type of the source
	SourceType string
	// LastAccessed is the time the template was last accessed
	LastAccessed time.Time
	// AccessCount is the number of times the template has been accessed
	AccessCount int
}

TemplateIndexEntry contains information about a template source

type TemplateLoader

type TemplateLoader = types.TemplateLoader

TemplateLoader is an alias for types.TemplateLoader

type TemplateManager

type TemplateManager interface {
	GetTemplate(id string) (Template, error)
	ListTemplates() ([]Template, error)
	GetCategories() ([]string, error)
	LoadTemplate(path string) (Template, error)
	ValidateTemplate(template Template) error
}

TemplateManager manages templates

func NewTemplateManager

func NewTemplateManager(options *TemplateManagerOptions) (TemplateManager, error)

NewTemplateManager creates a new template manager

func NewTemplateManagerWrapper

func NewTemplateManagerWrapper(manager *DefaultTemplateManager) TemplateManager

NewTemplateManagerWrapper creates a new wrapper for DefaultTemplateManager

type TemplateManagerOptions

type TemplateManagerOptions struct {
	// Loaders is the list of template loaders
	Loaders []TemplateLoader
	// Parser is the template parser
	Parser TemplateParser
	// Executor is the template executor
	Executor TemplateExecutor
	// Reporter is the template reporter
	Reporter TemplateReporter
	// Cache is the template cache
	Cache TemplateCache
	// Registry is the template registry
	Registry TemplateRegistry
	// PreExecutionHooks are functions to run before template execution
	PreExecutionHooks []TemplateHook
	// PostExecutionHooks are functions to run after template execution
	PostExecutionHooks []TemplateHook
}

TemplateManagerOptions contains options for the template manager

type TemplateManagerWrapper

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

TemplateManagerWrapper wraps DefaultTemplateManager to implement the TemplateManager interface

func (*TemplateManagerWrapper) GetCategories

func (w *TemplateManagerWrapper) GetCategories() ([]string, error)

GetCategories implements TemplateManager interface

func (*TemplateManagerWrapper) GetTemplate

func (w *TemplateManagerWrapper) GetTemplate(id string) (Template, error)

GetTemplate implements TemplateManager interface

func (*TemplateManagerWrapper) ListTemplates

func (w *TemplateManagerWrapper) ListTemplates() ([]Template, error)

ListTemplates implements TemplateManager interface

func (*TemplateManagerWrapper) LoadTemplate

func (w *TemplateManagerWrapper) LoadTemplate(path string) (Template, error)

LoadTemplate implements TemplateManager interface

func (*TemplateManagerWrapper) ValidateTemplate

func (w *TemplateManagerWrapper) ValidateTemplate(template Template) error

ValidateTemplate implements TemplateManager interface

type TemplateParser

type TemplateParser interface {
	// Parse parses a template
	Parse(template *format.Template) error
	// Validate validates a template
	Validate(template *format.Template) error
	// ResolveVariables resolves variables in a template
	ResolveVariables(template *format.Template, variables map[string]interface{}) error
}

TemplateParser is the interface for parsing templates

type TemplateRegistry

type TemplateRegistry interface {
	// Register registers a template
	Register(template *format.Template) error
	// Unregister unregisters a template
	Unregister(id string) error
	// Get gets a template from the registry
	Get(id string) (*format.Template, error)
	// List lists all templates in the registry
	List() []*format.Template
}

TemplateRegistry is the interface for registering templates

type TemplateReporter

type TemplateReporter interface {
	// GenerateReport generates a report for template execution results
	GenerateReport(results []*TemplateResult, format string) ([]byte, error)
}

TemplateReporter is the interface for generating reports

type TemplateResult

type TemplateResult = interfaces.TemplateResult

TemplateResult is an alias for interfaces.TemplateResult

func RunTemplate

func RunTemplate(ctx context.Context, manager *Manager, templateID string, options map[string]interface{}) (*TemplateResult, error)

RunTemplate runs a template with the specified options

func RunTemplates

func RunTemplates(ctx context.Context, manager *Manager, templateIDs []string, options map[string]interface{}) ([]*TemplateResult, error)

RunTemplates runs multiple templates with the specified options

type TemplateSource

type TemplateSource = interfaces.TemplateSource

TemplateSource is an alias for interfaces.TemplateSource

type TemplateStatus

type TemplateStatus = interfaces.TemplateStatus

TemplateStatus is an alias for interfaces.TemplateStatus

Directories

Path Synopsis
Package benchmark provides tools for benchmarking template operations.
Package benchmark provides tools for benchmarking template operations.
Package cache provides caching functionality for templates.
Package cache provides caching functionality for templates.
Package execution provides functionality for executing templates against LLM systems.
Package execution provides functionality for executing templates against LLM systems.
Package interfaces provides interfaces for template management components
Package interfaces provides interfaces for template management components
Package loader provides functionality for loading templates from various sources.
Package loader provides functionality for loading templates from various sources.
Package loaders provides template loaders for different sources
Package loaders provides template loaders for different sources
Package monitoring provides performance monitoring for template operations.
Package monitoring provides performance monitoring for template operations.
Package parser provides functionality for parsing and validating templates.
Package parser provides functionality for parsing and validating templates.
Package ratelimit provides rate limiting functionality for template execution.
Package ratelimit provides rate limiting functionality for template execution.
cmd/profiler command
Command profiler provides a command-line tool for profiling the rate limiting system
Command profiler provides a command-line tool for profiling the rate limiting system
Package registry provides functionality for registering and managing templates.
Package registry provides functionality for registering and managing templates.
Package reporting provides functionality for generating reports of template execution results.
Package reporting provides functionality for generating reports of template execution results.
Package streaming provides functionality for streaming processing of templates.
Package streaming provides functionality for streaming processing of templates.
Package structure provides functionality for optimizing template structure.
Package structure provides functionality for optimizing template structure.
Package types provides common types and interfaces for template management.
Package types provides common types and interfaces for template management.
Package validation provides functionality for validating templates and inputs before execution.
Package validation provides functionality for validating templates and inputs before execution.

Jump to

Keyboard shortcuts

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