service

package
v0.0.0-...-2528dd6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleHttpRequestForUploading

func HandleHttpRequestForUploading(service *Service, httpRequest *models.HttpRequest, response interface{})

func RefreshTokenFunc

func RefreshTokenFunc(service *Service)

Types

type Service

type Service struct {
	ClientID                string
	ClientSecret            string
	AccessToken             string
	Scope                   string
	RedirectUrl             string
	TenantID                string
	RefreshToken            string
	Expiry                  int64
	TokenType               string
	UploadFolderPath        string
	RefreshAPIEndPoint      string
	UploadAPIEndPoint       string
	ShareAPIEndPoint        string
	CreateFolderAPIEndPoint string
	FragSize                int
	GetItemsPathEndPoint    string
	GetItemAPIEndPoint      string
	DeleteItemAPIEndPoint   string
	MoveItemAPIEndPoint     string
	CopyItemAPIEndPoint     string
	DownloadItemAPIEndPoint string

	ShareBodyJSON        string
	UploadBodyJSON       string
	CreateFolderBodyJSON string
	MoveItemBodyJSON     string
	CopyItemBodyJSON     string

	ExpiredTime time.Time

	//Token
	SavedToken *oauth2.Token

	//Auths
	OauthConf *oauth2.Config
}

func LoadConfigFromFile

func LoadConfigFromFile() (*Service, error)

func LoadConfigFromJson

func LoadConfigFromJson(config *models.Config) (*Service, error)

func (*Service) CopyItem

func (service *Service) CopyItem(itemInfo *models.ItemInfo, newItemName string) (bool, error)

func (*Service) CopyItemByPath

func (service *Service) CopyItemByPath(itemPath string, newFileName string) (bool, error)

func (*Service) CreateFolder

func (service *Service) CreateFolder(newFolderName string, parentFolder *models.ItemInfo) (*models.ItemInfo, error)

func (*Service) CreateFolderForParentName

func (service *Service) CreateFolderForParentName(newFolderName string, parentFolderName string)

func (*Service) DeleteItem

func (service *Service) DeleteItem(itemInfo *models.ItemInfo) (bool, error)

func (*Service) DeleteItemByPath

func (service *Service) DeleteItemByPath(itemPath string) (bool, error)

func (*Service) GetChildItemsByPath

func (service *Service) GetChildItemsByPath(path string) ([]*models.ItemInfo, error)

func (*Service) GetDownloadLinkItem

func (service *Service) GetDownloadLinkItem(itemInfo *models.ItemInfo) (string, error)

func (*Service) GetDownloadLinkItemByPath

func (service *Service) GetDownloadLinkItemByPath(itemPath string) (string, error)

func (*Service) GetItemByPath

func (service *Service) GetItemByPath(path string) (*models.ItemInfo, error)

func (*Service) MoveItem

func (service *Service) MoveItem(itemInfo *models.ItemInfo, parentFolderInfo *models.ItemInfo, newItemName string) (bool, error)

func (*Service) MoveItemByPath

func (service *Service) MoveItemByPath(itemPath string, parentFolderPath string) (bool, error)

func (*Service) MoveItemByPathWithNewName

func (service *Service) MoveItemByPathWithNewName(itemPath string, parentFolderPath string, newFileName string) (bool, error)

func (*Service) ShareLinkFunc

func (service *Service) ShareLinkFunc(uploadFinishedResponse *models.UploadFinishedResponse) *models.SharedLinkResponse

func (*Service) UploadFile

func (service *Service) UploadFile(localFilePath string) (*models.UploadFinishedResponse, error)

Jump to

Keyboard shortcuts

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