factory

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package factory provides a factory for creating ExecutionBackend instances from YAML configuration files. This enables no-code agent deployment by allowing backends to be specified purely through configuration.

Index

Constants

View Source
const (
	// DefaultRESTTimeout is the default timeout for REST API requests
	DefaultRESTTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

func LoadFromYAML

func LoadFromYAML(path string) (fabric.ExecutionBackend, error)

LoadFromYAML loads a backend from a YAML configuration file

func NewBackend

func NewBackend(config *loomv1.BackendConfig) (fabric.ExecutionBackend, error)

NewBackend creates a backend from a proto config

func NewMCPBackendWithClient

func NewMCPBackendWithClient(config *loomv1.BackendConfig, mcpClient mcp.MCPClient) (fabric.ExecutionBackend, error)

NewMCPBackendWithClient creates an MCP backend with provided client

Types

type FileBackend

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

FileBackend provides a simple file-based backend

func (*FileBackend) Capabilities

func (b *FileBackend) Capabilities() *fabric.Capabilities

func (*FileBackend) Close

func (b *FileBackend) Close() error

func (*FileBackend) ExecuteCustomOperation

func (b *FileBackend) ExecuteCustomOperation(ctx context.Context, op string, params map[string]interface{}) (interface{}, error)

func (*FileBackend) ExecuteQuery

func (b *FileBackend) ExecuteQuery(ctx context.Context, query string) (*fabric.QueryResult, error)

func (*FileBackend) GetMetadata

func (b *FileBackend) GetMetadata(ctx context.Context, resource string) (map[string]interface{}, error)

func (*FileBackend) GetSchema

func (b *FileBackend) GetSchema(ctx context.Context, resource string) (*fabric.Schema, error)

func (*FileBackend) ListResources

func (b *FileBackend) ListResources(ctx context.Context, filters map[string]string) ([]fabric.Resource, error)

func (*FileBackend) Name

func (b *FileBackend) Name() string

func (*FileBackend) Ping

func (b *FileBackend) Ping(ctx context.Context) error

type GenericSQLBackend

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

GenericSQLBackend provides a generic SQL database backend implementation

func (*GenericSQLBackend) Capabilities

func (b *GenericSQLBackend) Capabilities() *fabric.Capabilities

func (*GenericSQLBackend) Close

func (b *GenericSQLBackend) Close() error

func (*GenericSQLBackend) ExecuteCustomOperation

func (b *GenericSQLBackend) ExecuteCustomOperation(ctx context.Context, op string, params map[string]interface{}) (interface{}, error)

func (*GenericSQLBackend) ExecuteQuery

func (b *GenericSQLBackend) ExecuteQuery(ctx context.Context, query string) (*fabric.QueryResult, error)

func (*GenericSQLBackend) GetMetadata

func (b *GenericSQLBackend) GetMetadata(ctx context.Context, resource string) (map[string]interface{}, error)

func (*GenericSQLBackend) GetSchema

func (b *GenericSQLBackend) GetSchema(ctx context.Context, resource string) (*fabric.Schema, error)

func (*GenericSQLBackend) ListResources

func (b *GenericSQLBackend) ListResources(ctx context.Context, filters map[string]string) ([]fabric.Resource, error)

func (*GenericSQLBackend) Name

func (b *GenericSQLBackend) Name() string

func (*GenericSQLBackend) Ping

func (b *GenericSQLBackend) Ping(ctx context.Context) error

type RESTBackend

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

RESTBackend provides a REST API backend

func (*RESTBackend) Capabilities

func (b *RESTBackend) Capabilities() *fabric.Capabilities

func (*RESTBackend) Close

func (b *RESTBackend) Close() error

func (*RESTBackend) ExecuteCustomOperation

func (b *RESTBackend) ExecuteCustomOperation(ctx context.Context, op string, params map[string]interface{}) (interface{}, error)

func (*RESTBackend) ExecuteQuery

func (b *RESTBackend) ExecuteQuery(ctx context.Context, query string) (*fabric.QueryResult, error)

func (*RESTBackend) GetMetadata

func (b *RESTBackend) GetMetadata(ctx context.Context, resource string) (map[string]interface{}, error)

func (*RESTBackend) GetSchema

func (b *RESTBackend) GetSchema(ctx context.Context, resource string) (*fabric.Schema, error)

func (*RESTBackend) ListResources

func (b *RESTBackend) ListResources(ctx context.Context, filters map[string]string) ([]fabric.Resource, error)

func (*RESTBackend) Name

func (b *RESTBackend) Name() string

func (*RESTBackend) Ping

func (b *RESTBackend) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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