/
fileinfo.go
36 lines (32 loc) · 1.02 KB
/
fileinfo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package librfm
import (
"errors"
"time"
)
// ErrFileNotFound is the error returned in case a call to
// the rr_fileinfo interface was successful but returned err != 0
var ErrFileNotFound = errors.New("File not found")
// Fileinfo is the structure returned at rr_fileinfo interface
type Fileinfo struct {
// Err holds a numeric error code where 0 means no error
Err uint64
// Size is the size of a file in bytes (0 for directories)
Size uint64
Timestamp localTime `json:"lastModified"`
// Height in mm for a job file
Height float64
// FirstLayerHeight in mm for a job file
FirstLayerHeight float64
// LayerHeight in mm for a job file
LayerHeight float64
// PrintTime in seconds for a job file
PrintTime uint64
// Filament contains an array of used filaments in mm
Filament []float64
// GeneratedBy returns the string which application created the job file
GeneratedBy string
}
// LastModified returns the last modification time of this file
func (f *Fileinfo) LastModified() time.Time {
return f.Timestamp.Time
}