Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StorageHeaders = map[StorageType][]string{ MOTION: { "time", "altitude", "velocity", "acceleration", "thrust", }, EVENTS: { "time", "motor_status", "parachute_status", }, DYNAMICS: { "time", "position_x", "position_y", "position_z", "velocity_x", "velocity_y", "velocity_z", "acceleration_x", "acceleration_y", "acceleration_z", "orientation_x", "orientation_y", "orientation_z", "orientation_w", }, }
StorageHeaders is a map of columns for storage types
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Name string
Hash string
LastModified time.Time
Path string
Motion *Storage
Events *Storage
Dynamics *Storage
}
type RecordManager ¶
type RecordManager struct {
// contains filtered or unexported fields
}
RecordManager manages simulation records
func NewRecordManager ¶
func NewRecordManager(baseDir string) (*RecordManager, error)
func (*RecordManager) CreateRecord ¶
func (rm *RecordManager) CreateRecord() (*Record, error)
CreateRecord creates a new record with a unique hash
func (*RecordManager) DeleteRecord ¶
func (rm *RecordManager) DeleteRecord(hash string) error
DeleteRecord deletes a record by Hash
func (*RecordManager) GetRecord ¶
func (rm *RecordManager) GetRecord(hash string) (*Record, error)
GetRecord retrieves an existing record by hash without creating a new one.
func (*RecordManager) ListRecords ¶
func (rm *RecordManager) ListRecords() ([]*Record, error)
ListRecords lists all existing records in the base directory with their last modified time.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a service that writes csv's to disk
func NewStorage ¶
func NewStorage(baseDir string, dir string, store StorageType) (*Storage, error)
NewStorage creates a new storage service. If the provided baseDir is not absolute, it is prepended with the user's home directory.
func (*Storage) GetFilePath ¶
GetFilePath returns the file path of the storage service.
func (*Storage) ReadHeadersAndData ¶
ReadHeadersAndData reads the headers and data separately from the storage file
type StorageInterface ¶
type StorageType ¶
type StorageType string
StorageType is the type of storage service (MOTION, EVENTS, etc.)
const ( // MOTION storage StorageType MOTION StorageType = "MOTION" // EVENTS storage StorageType EVENTS StorageType = "EVENTS" // DYNAMICS storage StorageType DYNAMICS StorageType = "DYNAMICS" )