Documentation
¶
Index ¶
- Constants
- Variables
- type Collection
- type ModelChunk
- type ModelMetadata
- type ModelSummary
- type Node
- type Object
- type ObjectService
- type Organizer
- type Referencer
- type Storage
- func (s *Storage) DeleteModel(ctx context.Context, modelID string) error
- func (s *Storage) DeleteObject(ctx context.Context, id string) error
- func (s *Storage) GetModel(ctx context.Context, modelID string) (*ModelMetadata, error)
- func (s *Storage) GetModelMetadata(ctx context.Context, modelID string) (interface{}, error)
- func (s *Storage) GetObject(ctx context.Context, id string) (*Object, error)
- func (s *Storage) GetStatus(ctx context.Context) (*StorageStatus, error)
- func (s *Storage) ListModels(ctx context.Context) ([]ModelMetadata, error)
- func (s *Storage) StoreModel(ctx context.Context, name string, format string, reader io.Reader) (*ModelMetadata, error)
- func (s *Storage) StoreObject(ctx context.Context, obj *Object) error
- func (s *Storage) StreamModel(ctx context.Context, modelID string, writer io.Writer) error
- type StorageStatus
Constants ¶
const ChunkSize = 1024 * 1024 * 5 // 5MB chunks
Variables ¶
var (
ErrCollectionNotFound = errors.New("collection not found")
)
Error definitions
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
ID string `json:"id"`
Name string `json:"name"`
Objects []string `json:"objects"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Collection represents a group of related objects
type ModelChunk ¶
type ModelMetadata ¶
type ModelMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
Format string `json:"format"`
Size int64 `json:"size"`
Hash string `json:"hash"`
Chunks []string `json:"chunks"`
CreatedAt time.Time `json:"created_at"`
Owner string `json:"owner"`
Permissions []string `json:"permissions"`
}
func (*ModelMetadata) CalculateHash ¶
func (m *ModelMetadata) CalculateHash() string
type ModelSummary ¶
type Object ¶
type Object struct {
ID string `json:"id"`
Name string `json:"name"`
Format string `json:"format"`
Size int64 `json:"size"`
BlockHashes []string `json:"blocks"`
Materials []string `json:"materials,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Object represents a 3D model object with its metadata and blocks
type ObjectService ¶
type ObjectService struct {
// contains filtered or unexported fields
}
ObjectService handles operations on 3D model objects
func NewObjectService ¶
func NewObjectService(blockService *blocks.Service, storage *Storage) *ObjectService
NewObjectService creates a new object service instance
func (*ObjectService) CreateObject ¶
func (s *ObjectService) CreateObject(ctx context.Context, name, format string, data []byte) (*Object, error)
CreateObject creates a new 3D model object
func (*ObjectService) DeleteObject ¶
func (s *ObjectService) DeleteObject(ctx context.Context, id string) error
DeleteObject removes an object and its blocks
type Organizer ¶
type Organizer struct {
// contains filtered or unexported fields
}
Organizer manages object relationships and collections
func NewOrganizer ¶
func NewOrganizer(referencer *Referencer) *Organizer
NewOrganizer creates a new organizer instance
func (*Organizer) AddToCollection ¶
AddToCollection adds an object to a collection
func (*Organizer) CreateCollection ¶
CreateCollection creates a new collection
func (*Organizer) GetCollection ¶
GetCollection retrieves a collection by ID
type Referencer ¶
type Referencer struct {
// contains filtered or unexported fields
}
Referencer manages references between objects and their dependencies
func NewReferencer ¶
func NewReferencer() *Referencer
NewReferencer creates a new referencer instance
func (*Referencer) AddReference ¶
func (r *Referencer) AddReference(ctx context.Context, fromID, toID string) error
AddReference adds a reference from one object to another
func (*Referencer) GetBackReferences ¶
GetBackReferences returns all objects that reference the given object
func (*Referencer) GetReferences ¶
GetReferences returns all objects referenced by the given object
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) DeleteModel ¶
func (*Storage) DeleteObject ¶
DeleteObject removes an object's metadata
func (*Storage) GetModelMetadata ¶
GetModelMetadata retrieves metadata for a specific model by ID
func (*Storage) GetStatus ¶
func (s *Storage) GetStatus(ctx context.Context) (*StorageStatus, error)
GetStatus returns the current status of the storage system
func (*Storage) ListModels ¶
func (s *Storage) ListModels(ctx context.Context) ([]ModelMetadata, error)
func (*Storage) StoreModel ¶
func (*Storage) StoreObject ¶
StoreObject stores an object's metadata
type StorageStatus ¶
type StorageStatus struct {
TotalModels int `json:"total_models"`
TotalSize int64 `json:"total_size"`
BasePath string `json:"base_path"`
Models []ModelSummary `json:"models"`
}
StorageStatus represents the current state of the storage system