alist/internal/model/object.go

36 lines
455 B
Go
Raw Normal View History

2022-06-15 10:06:42 +00:00
package model
2022-06-06 13:48:53 +00:00
2022-06-15 12:41:17 +00:00
import "time"
2022-06-06 13:48:53 +00:00
2022-06-15 12:41:17 +00:00
type Object struct {
ID string
Name string
2022-06-23 07:57:36 +00:00
Size int64
2022-06-15 12:41:17 +00:00
Modified time.Time
IsFolder bool
2022-06-06 13:48:53 +00:00
}
2022-06-15 12:41:17 +00:00
func (f Object) GetName() string {
return f.Name
2022-06-06 13:48:53 +00:00
}
2022-06-07 14:02:41 +00:00
2022-06-23 07:57:36 +00:00
func (f Object) GetSize() int64 {
2022-06-15 12:41:17 +00:00
return f.Size
2022-06-07 14:02:41 +00:00
}
2022-06-15 12:41:17 +00:00
func (f Object) ModTime() time.Time {
return f.Modified
}
func (f Object) IsDir() bool {
return f.IsFolder
}
func (f Object) GetID() string {
return f.ID
2022-06-07 14:02:41 +00:00
}
2022-06-16 12:25:33 +00:00
func (f *Object) SetID(id string) {
f.ID = id
}