Documentation
¶
Index ¶
- type Config
- type FileResource
- func (r *FileResource) GetAnnotations() *resources.ResourceAnnotations
- func (r *FileResource) GetCurrentSize() (int64, error)
- func (r *FileResource) GetSize() *int64
- func (r *FileResource) Read(ctx context.Context, params map[string]any) (any, error)
- func (r *FileResource) ToConfig() resources.ResourceConfig
- type FileTemplate
- type TemplateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
resources.ResourceConfigBase `yaml:",inline"`
Path string `yaml:"path" validate:"required"`
MaxSize *int64 `yaml:"maxSize,omitempty"`
// contains filtered or unexported fields
}
Config represents the configuration for a file resource.
func (*Config) Initialize ¶
Initialize validates the configuration and initializes the file resource.
func (*Config) ResourceConfigType ¶
ResourceConfigType returns the resource type identifier.
type FileResource ¶
FileResource handles reading content from a local file.
func (*FileResource) GetAnnotations ¶
func (r *FileResource) GetAnnotations() *resources.ResourceAnnotations
GetAnnotations returns the resource annotations, dynamically computing the LastModified timestamp.
func (*FileResource) GetCurrentSize ¶
func (r *FileResource) GetCurrentSize() (int64, error)
GetCurrentSize returns the actual size of the file on disk.
func (*FileResource) GetSize ¶
func (r *FileResource) GetSize() *int64
GetSize returns the configured maximum size of the file.
func (*FileResource) ToConfig ¶
func (r *FileResource) ToConfig() resources.ResourceConfig
ToConfig returns the original configuration for this resource.
type FileTemplate ¶
type FileTemplate struct {
TemplateConfig
// contains filtered or unexported fields
}
FileTemplate handles reading content from a file template URI.
func (*FileTemplate) ToConfig ¶
func (r *FileTemplate) ToConfig() resources.ResourceTemplateConfig
ToConfig returns the original configuration for this template.
type TemplateConfig ¶
type TemplateConfig struct {
resources.ResourceTemplateConfigBase `yaml:",inline"`
AllowedPaths []string `yaml:"allowedPaths,omitempty"`
MaxSize *int64 `yaml:"maxSize,omitempty"`
// contains filtered or unexported fields
}
TemplateConfig represents the configuration for a file resource template.
func (*TemplateConfig) Initialize ¶
func (c *TemplateConfig) Initialize(ctx context.Context) (resources.ResourceTemplate, error)
Initialize validates the configuration and initializes the file resource template.
func (*TemplateConfig) ResourceTemplateConfigType ¶
func (c *TemplateConfig) ResourceTemplateConfigType() string
func (*TemplateConfig) Validate ¶
func (c *TemplateConfig) Validate() error
Validate performs template-specific validation including URI scheme checks.