blocks

package
v0.0.0-...-90c1326 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Hash string
	Size int64
	Data []byte
}

Block represents a chunk of 3D model data

type Service

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

Service handles block-related operations

func NewService

func NewService(store *Store) *Service

NewService creates a new block service instance

func (*Service) DeleteBlock

func (s *Service) DeleteBlock(ctx context.Context, hash string) error

DeleteBlock removes a block from storage

func (*Service) GetModelBlocks

func (s *Service) GetModelBlocks(ctx context.Context, hashes []string) ([]*Block, error)

GetModelBlocks retrieves all blocks for a model

func (*Service) ProcessModelData

func (s *Service) ProcessModelData(ctx context.Context, format string, reader io.Reader) ([]string, error)

ProcessModelData processes model data and stores it as blocks

type Store

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

Store manages the storage of model data blocks

func NewStore

func NewStore(basePath string) (*Store, error)

NewStore creates a new block store instance

func (*Store) DeleteBlock

func (s *Store) DeleteBlock(ctx context.Context, hash string) error

DeleteBlock removes a block from storage

func (*Store) GetBlock

func (s *Store) GetBlock(ctx context.Context, hash string) (*Block, error)

GetBlock retrieves a block by its hash

func (*Store) StoreBlock

func (s *Store) StoreBlock(ctx context.Context, data []byte) (string, error)

StoreBlock stores a block of data and returns its hash

Jump to

Keyboard shortcuts

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