12345678910111213141516171819202122232425262728293031323334 |
- package basefs
- import (
- "os"
- "time"
- )
- // This could be a struct
- // And service would be creating these
- type File struct {
- ID string
- Name string
- // Build Attr from this
- Size uint64
- CreatedTime time.Time
- ModifiedTime time.Time
- AccessedTime time.Time
- Mode os.FileMode
- Parents []string
- Data interface{} // Any thing
- }
- func (f *File) HasParent(parent *File) bool {
- parentID := ""
- if parent != nil {
- parentID = parent.ID
- }
- for _, p := range f.Parents {
- if p == parentID {
- return true
- }
- }
- return false
- }
|