Documentation
¶
Index ¶
- Variables
- func ErrNotFound(container, artifact string) error
- func ErrPermissionDenied(tenantID, action string) error
- func RequestIDFromContext(ctx context.Context) (string, bool)
- func TenantIDFromContext(ctx context.Context) (string, bool)
- func WithRequestID(ctx context.Context, requestID string) context.Context
- func WithTenantID(ctx context.Context, tenantID string) context.Context
- func WrapError(err error, message string) error
- type AccessEvent
- type Artifact
- type ComputeEngine
- type Container
- type CoreEngine
- func (e *CoreEngine) AddDriver(name string, driver Driver)
- func (e *CoreEngine) Delete(ctx context.Context, container, artifact string) error
- func (e *CoreEngine) Execute(ctx context.Context, container string, wasm []byte, input io.Reader) (io.Reader, error)
- func (e *CoreEngine) Get(ctx context.Context, container, artifact string) (io.ReadCloser, error)
- func (e *CoreEngine) GetArtifactMetadata(ctx context.Context, container, artifact string) (*Artifact, error)
- func (e *CoreEngine) GetContainerMetadata(ctx context.Context, container string) (*Container, error)
- func (e *CoreEngine) GetMetrics(ctx context.Context) (map[string]interface{}, error)
- func (e *CoreEngine) HealthCheck(ctx context.Context) error
- func (e *CoreEngine) List(ctx context.Context, container, prefix string) ([]Artifact, error)
- func (e *CoreEngine) Predict(ctx context.Context, model string, input []byte) ([]byte, error)
- func (e *CoreEngine) Put(ctx context.Context, container, artifact string, data io.Reader, ...) error
- func (e *CoreEngine) Query(ctx context.Context, sql string) (ResultSet, error)
- func (e *CoreEngine) SetBackup(name string)
- func (e *CoreEngine) SetPrimary(name string)
- func (e *CoreEngine) Train(ctx context.Context, model string, data []byte) error
- type Driver
- type Engine
- type MLEngine
- type NotFoundError
- type Operation
- type PermissionError
- type PutOption
- type PutOptions
- type Result
- type ResultSet
Constants ¶
This section is empty.
Variables ¶
var ( ErrQuotaExceeded = fmt.Errorf("quota exceeded") ErrInvalidInput = fmt.Errorf("invalid input") ErrTimeout = fmt.Errorf("operation timeout") )
Common errors
Functions ¶
func ErrNotFound ¶
func ErrPermissionDenied ¶
Types ¶
type AccessEvent ¶
type AccessEvent struct {
Container string
Artifact string
Operation string
Timestamp time.Time
Latency time.Duration
Size int64
Success bool
}
AccessEvent for ML training data
type Artifact ¶
type Artifact struct {
ID string `json:"id"`
Container string `json:"container"`
Key string `json:"key"`
Type string `json:"type"` // "blob", "wasm", "model", "vector", "dataset"
Size int64 `json:"size"`
Modified time.Time `json:"modified"`
ETag string `json:"etag"`
Metadata map[string]interface{} `json:"metadata"`
// Hidden ML/AI fields
Features map[string]float64 `json:"-"` // For ML training
Vector []float64 `json:"-"` // For similarity search
AccessCount int64 `json:"-"` // For smart caching
LastAccess time.Time `json:"-"` // For tiering decisions
}
Artifact replaces Object - ready for any data type
type ComputeEngine ¶
type ComputeEngine interface {
LoadModule(wasm []byte) error
Execute(input []byte) ([]byte, error)
}
ComputeEngine for WASM execution (future use)
type Container ¶
type Container struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // "storage", "compute", "ml-model", "vector-db"
Created time.Time `json:"created"`
Metadata map[string]interface{} `json:"metadata"`
// Hidden ML fields (not exposed in S3 API)
Temperature float64 `json:"-"` // Access frequency score
Tier string `json:"-"` // "hot", "warm", "cold", "archive"
}
Container replaces Bucket - ready for compute/ML workloads
type CoreEngine ¶
type CoreEngine struct {
// contains filtered or unexported fields
}
CoreEngine implements the Engine interface
func NewEngine ¶
func NewEngine(logger *zap.Logger) *CoreEngine
NewEngine creates a new engine instance
func (*CoreEngine) AddDriver ¶
func (e *CoreEngine) AddDriver(name string, driver Driver)
AddDriver adds a storage driver
func (*CoreEngine) Delete ¶
func (e *CoreEngine) Delete(ctx context.Context, container, artifact string) error
Delete removes an artifact (S3 DeleteObject)
func (*CoreEngine) Execute ¶
func (e *CoreEngine) Execute(ctx context.Context, container string, wasm []byte, input io.Reader) (io.Reader, error)
Hidden WASM execution (returns error for now)
func (*CoreEngine) Get ¶
func (e *CoreEngine) Get(ctx context.Context, container, artifact string) (io.ReadCloser, error)
Get retrieves an artifact (S3 GetObject)
func (*CoreEngine) GetArtifactMetadata ¶
func (e *CoreEngine) GetArtifactMetadata(ctx context.Context, container, artifact string) (*Artifact, error)
GetArtifactMetadata returns artifact metadata
func (*CoreEngine) GetContainerMetadata ¶
func (e *CoreEngine) GetContainerMetadata(ctx context.Context, container string) (*Container, error)
GetContainerMetadata returns container metadata
func (*CoreEngine) GetMetrics ¶
func (e *CoreEngine) GetMetrics(ctx context.Context) (map[string]interface{}, error)
GetMetrics returns engine metrics
func (*CoreEngine) HealthCheck ¶
func (e *CoreEngine) HealthCheck(ctx context.Context) error
HealthCheck verifies all drivers are healthy
func (*CoreEngine) Put ¶
func (e *CoreEngine) Put(ctx context.Context, container, artifact string, data io.Reader, opts ...PutOption) error
Put stores an artifact (S3 PutObject)
func (*CoreEngine) SetBackup ¶
func (e *CoreEngine) SetBackup(name string)
SetBackup sets the backup driver
func (*CoreEngine) SetPrimary ¶
func (e *CoreEngine) SetPrimary(name string)
SetPrimary sets the primary driver
type Driver ¶
type Driver interface {
Name() string
Get(ctx context.Context, container, artifact string) (io.ReadCloser, error)
Put(ctx context.Context, container, artifact string, data io.Reader, opts ...PutOption) error
Delete(ctx context.Context, container, artifact string) error
List(ctx context.Context, container, prefix string) ([]string, error)
HealthCheck(ctx context.Context) error
}
Driver interface for storage backends - FIXED to use container/artifact
type Engine ¶
type Engine interface {
// Storage operations (visible to users)
Get(ctx context.Context, container, artifact string) (io.ReadCloser, error)
Put(ctx context.Context, container, artifact string, data io.Reader, opts ...PutOption) error
Delete(ctx context.Context, container, artifact string) error
List(ctx context.Context, container, prefix string) ([]Artifact, error)
// Hidden capabilities (implement as no-ops for now)
Execute(ctx context.Context, container string, wasm []byte, input io.Reader) (io.Reader, error)
Query(ctx context.Context, sql string) (ResultSet, error)
Train(ctx context.Context, model string, data []byte) error
Predict(ctx context.Context, model string, input []byte) ([]byte, error)
// Metadata operations
GetContainerMetadata(ctx context.Context, container string) (*Container, error)
GetArtifactMetadata(ctx context.Context, container, artifact string) (*Artifact, error)
// Health and metrics
HealthCheck(ctx context.Context) error
GetMetrics(ctx context.Context) (map[string]interface{}, error)
}
Engine is the universal interface for storage, compute, and ML
type MLEngine ¶
type MLEngine interface {
LoadModel(path string) error
Train(data [][]float64, labels []float64) error
Predict(input []float64) (float64, error)
}
MLEngine for machine learning operations (future use)
type NotFoundError ¶
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Operation ¶
type Operation struct {
Type string // "get", "put", "delete", "compute", "query"
Container string
Artifact string
Context context.Context
Metadata map[string]interface{}
}
Operation represents any engine operation (not just storage)
type PermissionError ¶
func (PermissionError) Error ¶
func (e PermissionError) Error() string
type PutOption ¶
type PutOption func(*PutOptions)
PutOption is a function that configures Put operations
func WithContentType ¶
WithContentType sets the content type
func WithUserMetadata ¶
WithUserMetadata sets user metadata
type PutOptions ¶
type PutOptions struct {
ContentType string
CacheControl string
ContentEncoding string
ContentLanguage string
UserMetadata map[string]string
}
PutOptions holds options for Put operations