Some misc changes
This commit is contained in:
parent
bb266ff276
commit
4f197a4009
@ -27,7 +27,7 @@ type LiteDriveItemable interface {
|
|||||||
GetMalware() interface{}
|
GetMalware() interface{}
|
||||||
GetDeleted() interface{}
|
GetDeleted() interface{}
|
||||||
GetRoot() interface{}
|
GetRoot() interface{}
|
||||||
GetFile() fileItemable
|
GetFile() *fileItema
|
||||||
GetParentReference() parentReferenceable
|
GetParentReference() parentReferenceable
|
||||||
SetParentReference(parentReferenceable)
|
SetParentReference(parentReferenceable)
|
||||||
GetCreatedBy() itemIdentitySetable
|
GetCreatedBy() itemIdentitySetable
|
||||||
@ -39,34 +39,34 @@ type LiteDriveItemable interface {
|
|||||||
var _ LiteDriveItemable = &driveItema{}
|
var _ LiteDriveItemable = &driveItema{}
|
||||||
|
|
||||||
type driveItema struct {
|
type driveItema struct {
|
||||||
id string
|
id *string
|
||||||
name string
|
name *string
|
||||||
size int64
|
size *int64
|
||||||
folder interface{}
|
folder interface{}
|
||||||
pkg interface{}
|
pkg interface{}
|
||||||
shared interface{}
|
shared interface{}
|
||||||
malware interface{}
|
malware interface{}
|
||||||
deleted interface{}
|
deleted interface{}
|
||||||
root interface{}
|
root interface{}
|
||||||
file fileItemable
|
file *fileItema
|
||||||
parentRef parentReferenceable
|
parentRef parentReferenceable
|
||||||
createdBy itemIdentitySetable
|
createdBy itemIdentitySetable
|
||||||
createdDateTime time.Time
|
createdDateTime *time.Time
|
||||||
lastModifiedDateTime time.Time
|
lastModifiedDateTime *time.Time
|
||||||
additionalData map[string]interface{}
|
additionalData map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func (c *driveItema) GetId() *string {
|
func (c *driveItema) GetId() *string {
|
||||||
return &c.id
|
return c.id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetName() *string {
|
func (c *driveItema) GetName() *string {
|
||||||
return &c.name
|
return c.name
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetSize() *int64 {
|
func (c *driveItema) GetSize() *int64 {
|
||||||
return &c.size
|
return c.size
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetFolder() interface{} {
|
func (c *driveItema) GetFolder() interface{} {
|
||||||
@ -93,7 +93,7 @@ func (c *driveItema) GetRoot() interface{} {
|
|||||||
return c.root
|
return c.root
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetFile() fileItemable {
|
func (c *driveItema) GetFile() *fileItema {
|
||||||
return c.file
|
return c.file
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,11 +111,11 @@ func (c *driveItema) GetCreatedBy() itemIdentitySetable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetCreatedDateTime() *time.Time {
|
func (c *driveItema) GetCreatedDateTime() *time.Time {
|
||||||
return &c.createdDateTime
|
return c.createdDateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetLastModifiedDateTime() *time.Time {
|
func (c *driveItema) GetLastModifiedDateTime() *time.Time {
|
||||||
return &c.lastModifiedDateTime
|
return c.lastModifiedDateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *driveItema) GetAdditionalData() map[string]interface{} {
|
func (c *driveItema) GetAdditionalData() map[string]interface{} {
|
||||||
@ -123,9 +123,6 @@ func (c *driveItema) GetAdditionalData() map[string]interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
fileItemable interface {
|
|
||||||
GetMimeType() *string
|
|
||||||
}
|
|
||||||
parentReferenceable interface {
|
parentReferenceable interface {
|
||||||
GetPath() *string
|
GetPath() *string
|
||||||
GetId() *string
|
GetId() *string
|
||||||
@ -142,13 +139,11 @@ type (
|
|||||||
|
|
||||||
// Concrete implementations
|
// Concrete implementations
|
||||||
|
|
||||||
var _ fileItemable = &fileItem{}
|
type fileItema struct {
|
||||||
|
|
||||||
type fileItem struct {
|
|
||||||
mimeType string
|
mimeType string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fileItem) GetMimeType() *string {
|
func (f *fileItema) GetMimeType() *string {
|
||||||
return &f.mimeType
|
return &f.mimeType
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,18 +193,24 @@ func (iu *itemUser) GetAdditionalData() map[string]interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ToLiteDriveItemable(item models.DriveItemable) LiteDriveItemable {
|
func ToLiteDriveItemable(item models.DriveItemable) LiteDriveItemable {
|
||||||
cdi := &driveItema{
|
cdi := &driveItema{}
|
||||||
id: strings.Clone(ptr.Val(item.GetId())),
|
|
||||||
name: strings.Clone(ptr.Val(item.GetName())),
|
id := strings.Clone(ptr.Val(item.GetId()))
|
||||||
size: ptr.Val(item.GetSize()),
|
name := strings.Clone(ptr.Val(item.GetName()))
|
||||||
createdDateTime: ptr.Val(item.GetCreatedDateTime()),
|
size := ptr.Val(item.GetSize())
|
||||||
lastModifiedDateTime: ptr.Val(item.GetLastModifiedDateTime()),
|
createdDateTime := ptr.Val(item.GetCreatedDateTime())
|
||||||
}
|
lastModifiedDateTime := ptr.Val(item.GetLastModifiedDateTime())
|
||||||
|
|
||||||
|
cdi.id = &id
|
||||||
|
cdi.name = &name
|
||||||
|
cdi.size = &size
|
||||||
|
cdi.createdDateTime = &createdDateTime
|
||||||
|
cdi.lastModifiedDateTime = &lastModifiedDateTime
|
||||||
|
|
||||||
if item.GetFolder() != nil {
|
if item.GetFolder() != nil {
|
||||||
cdi.folder = &struct{}{}
|
cdi.folder = &struct{}{}
|
||||||
} else if item.GetFile() != nil {
|
} else if item.GetFile() != nil {
|
||||||
cdi.file = &fileItem{
|
cdi.file = &fileItema{
|
||||||
mimeType: strings.Clone(ptr.Val(item.GetFile().GetMimeType())),
|
mimeType: strings.Clone(ptr.Val(item.GetFile().GetMimeType())),
|
||||||
}
|
}
|
||||||
} else if item.GetPackageEscaped() != nil {
|
} else if item.GetPackageEscaped() != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user