cache

package
v0.0.0-...-05344fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCacheInvalid

func IsCacheInvalid(odd oneDriveDescription, cacheDescription *CacheDescription) error

func IsCacheNeedUpdate

func IsCacheNeedUpdate(odd oneDriveDescription, cacheDescription *CacheDescription) error

Types

type CacheDescription

type CacheDescription struct {
	RequestURL   string `json:"requestUrl"`
	Path         string `json:"path"`
	LastUpdateAt int64  `json:"createdAt"`
	Status       string `json:"status"` // Wait, Caching, Cached, Failed
}

type DriveCacheCollection

type DriveCacheCollection struct {
	MicrosoftGraphDriveItemCache []MicrosoftGraphDriveItemCache `json:"microsoftGraphDriveItemCache,omitempty"`
}

func (*DriveCacheCollection) GetMicrosoftGraphDriveContentURLFromCache

func (dcc *DriveCacheCollection) GetMicrosoftGraphDriveContentURLFromCache(odd oneDriveDescription, path string) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) GetMicrosoftGraphDriveFromCache

func (dcc *DriveCacheCollection) GetMicrosoftGraphDriveFromCache(odd oneDriveDescription, path string, isContentURL bool) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) GetMicrosoftGraphDriveFromCacheStep2

func (dcc *DriveCacheCollection) GetMicrosoftGraphDriveFromCacheStep2(odd oneDriveDescription, this MicrosoftGraphDriveItemCache, filename, path string, isContentURL bool) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) GetMicrosoftGraphDriveFromCacheStep3

func (dcc *DriveCacheCollection) GetMicrosoftGraphDriveFromCacheStep3(odd oneDriveDescription, this MicrosoftGraphDriveItemCache, children MicrosoftGraphDriveItemCache, path string) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) GetMicrosoftGraphDriveItemFromCache

func (dcc *DriveCacheCollection) GetMicrosoftGraphDriveItemFromCache(odd oneDriveDescription, path string) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) HitMicrosoftGraphDriveContentURLCache

func (dcc *DriveCacheCollection) HitMicrosoftGraphDriveContentURLCache(odd oneDriveDescription, path string) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) HitMicrosoftGraphDriveItemCache

func (dcc *DriveCacheCollection) HitMicrosoftGraphDriveItemCache(odd oneDriveDescription, path string) (*MicrosoftGraphDriveItemCache, error)

func (*DriveCacheCollection) Load

func (dcc *DriveCacheCollection) Load(microsoftGraphDrive *graphapi.MicrosoftGraphDrive) error

func (*DriveCacheCollection) Save

func (dcc *DriveCacheCollection) Save(microsoftGraphDrive *graphapi.MicrosoftGraphDrive) error

type MicrosoftGraphDriveItemCache

type MicrosoftGraphDriveItemCache struct {
	CacheDescription *CacheDescription `json:"cacheDescription,omitempty"`

	CTag        string                         `json:"cTag"` // etag
	Description *string                        `json:"description,omitempty"`
	File        *graphapi.MicrosoftGraphFile   `json:"file,omitempty"`
	Folder      *graphapi.MicrosoftGraphFolder `json:"folder,omitempty"`
	Size        int64                          `json:"size"`

	/* relationships */
	Children []MicrosoftGraphDriveItemCache `json:"children,omitempty"`

	/* inherited from baseItem */
	ID              string                                `json:"id"` // identifier
	CreatedAt       int64                                 `json:"createdAt"`
	ETag            string                                `json:"eTag"`
	LastModifiedAt  int64                                 `json:"lastModifiedAt"`
	Name            string                                `json:"name"`
	ParentReference *graphapi.MicrosoftGraphItemReference `json:"parentReference,omitempty"`
	WebURL          string                                `json:"webUrl"`

	/* instance annotations */
	AtMicrosoftGraphDownloadURL *string `json:"@microsoft.graph.downloadUrl"`
}

MicrosoftGraphDriveItemCache describes the MicrosoftGraphDriveItem cache structure

func DriveItemToCache

func DriveItemToCache(microsoftGraphDriveItem *graphapi.MicrosoftGraphDriveItem) (*MicrosoftGraphDriveItemCache, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL