Documentation
¶
Overview ¶
Package filesystem provides the filesystem upstream implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewUpstream ¶
NewUpstream creates a new instance of FilesystemUpstream.
Returns:
- upstream.Upstream: A new instance of the filesystem upstream.
Side Effects:
- None.
Summary: Initializes NewUpstream operation.
Parameters:
- TODO: Document parameters.
Returns:
- TODO: Document returns.
Errors:
- TODO: Document errors.
Side Effects:
- None.
Types ¶
type Upstream ¶
type Upstream struct {
// contains filtered or unexported fields
}
Upstream implements the upstream.Upstream interface for filesystem services.
It provides tools for interacting with various filesystem backends (local, S3, GCS, etc.) as defined in the service configuration.
Summary: Represents a Upstream.
func (*Upstream) Register ¶
func (u *Upstream) Register( ctx context.Context, serviceConfig *configv1.UpstreamServiceConfig, toolManager tool.ManagerInterface, _ prompt.ManagerInterface, _ resource.ManagerInterface, _ bool, ) (string, []*configv1.ToolDefinition, []*configv1.ResourceDefinition, error)
Register processes the configuration for a filesystem service.
Parameters:
- ctx (context.Context): The context for the registration process.
- serviceConfig (*configv1.UpstreamServiceConfig): The configuration for the upstream service.
- toolManager (tool.ManagerInterface): The manager where discovered tools will be registered.
- _ (prompt.ManagerInterface): Unused prompt manager.
- _ (resource.ManagerInterface): Unused resource manager.
- _ (bool): Unused reload flag.
Returns:
- string: The unique service ID.
- []*configv1.ToolDefinition: A list of registered tool definitions.
- []*configv1.ResourceDefinition: Always nil.
- error: An error if registration fails.
Side Effects:
- Creates a filesystem provider.
- Starts a health checker.
- Registers tools with the tool manager.
Summary: Executes Register operation.
Parameters:
- TODO: Document parameters.
Returns:
- TODO: Document returns.
Errors:
- TODO: Document errors.
Side Effects:
- None.
func (*Upstream) Shutdown ¶
Shutdown implements the upstream.Upstream interface.
Parameters:
- ctx (context.Context): The context for the shutdown operation (currently unused).
Returns:
- error: Always returns nil.
Side Effects:
- Stops the health checker.
- Closes all registered filesystem providers.
Summary: Executes Shutdown operation.
Parameters:
- TODO: Document parameters.
Returns:
- TODO: Document returns.
Errors:
- TODO: Document errors.
Side Effects:
- None.