onedrive_sharelink

package
v4.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNoRedirectCLient

func NewNoRedirectCLient() *http.Client

NewNoRedirectClient creates an HTTP client that doesn't follow redirects

Types

type Addition

type Addition struct {
	driver.RootPath
	ShareLinkURL       string `json:"url" required:"true"`
	ShareLinkPassword  string `json:"password"`
	DisableDiskUsage   bool   `json:"disable_disk_usage" default:"false"`
	EnableDirectUpload bool   `json:"enable_direct_upload" default:"false" help:"Allow uploading directly to OneDrive without going through OpenList"`
	IsSharepoint       bool

	Headers          http.Header
	HeaderTime       int64
	DriveURL         string
	DriveAccessToken string
	DriveTokenTime   int64
	// contains filtered or unexported fields
}

type FolderResp

type FolderResp struct {
	// Data holds the nested structure of the response.
	Data struct {
		Legacy struct {
			RenderListData struct {
				ListData struct {
					Items []Item `json:"Row"` // Items contains the list of items in the folder.
				} `json:"ListData"`
			} `json:"renderListDataAsStream"`
		} `json:"legacy"`
	} `json:"data"`
}

FolderResp represents the structure of the folder response from the OneDrive API.

type GraphQLNEWRequest

type GraphQLNEWRequest struct {
	ListData struct {
		NextHref string `json:"NextHref"` // NextHref is the link to the next set of data.
		Row      []Item `json:"Row"`      // Row contains the list of items.
	} `json:"ListData"`
}

GraphQLNEWRequest represents the structure of a new GraphQL request.

type GraphQLRequest

type GraphQLRequest struct {
	Data struct {
		Legacy struct {
			RenderListDataAsStream struct {
				ListData struct {
					NextHref string `json:"NextHref"` // NextHref is the link to the next set of data.
					Row      []Item `json:"Row"`      // Row contains the list of items.
				} `json:"ListData"`
				ViewMetadata struct {
					ListViewXml string `json:"ListViewXml"` // ListViewXml contains the XML of the list view.
				} `json:"ViewMetadata"`
			} `json:"renderListDataAsStream"`
		} `json:"legacy"`
	} `json:"data"`
}

GraphQLRequest represents the structure of a GraphQL request.

type Item

type Item struct {
	ObjType            string    `json:"FSObjType"`            // ObjType indicates if the item is a file or folder.
	Name               string    `json:"FileLeafRef"`          // Name is the name of the item.
	ModifiedTime       time.Time `json:"Modified."`            // ModifiedTime is the last modified time of the item.
	Size               string    `json:"File_x0020_Size"`      // Size is the size of the item in string format.
	Id                 string    `json:"UniqueId"`             // Id is the unique identifier of the item.
	SPItemURL          string    `json:".spItemUrl"`           // SPItemURL points to the SharePoint item metadata API.
	ContentDownloadURL string    `json:"@content.downloadUrl"` // ContentDownloadURL is a temporary cookie-free download URL.
}

Item represents an individual item in the folder.

type Object added in v4.2.3

type Object struct {
	model.ObjThumb
	SPItemURL          string
	ContentDownloadURL string
}
type OnedriveSharelink struct {
	model.Storage

	Addition
	// contains filtered or unexported fields
}

func (*OnedriveSharelink) Config

func (d *OnedriveSharelink) Config() driver.Config

func (*OnedriveSharelink) Copy

func (d *OnedriveSharelink) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*OnedriveSharelink) Drop

func (d *OnedriveSharelink) Drop(ctx context.Context) error

func (*OnedriveSharelink) GetAddition

func (d *OnedriveSharelink) GetAddition() driver.Additional

func (*OnedriveSharelink) GetDetails added in v4.2.3

func (d *OnedriveSharelink) GetDetails(ctx context.Context) (*model.StorageDetails, error)

func (*OnedriveSharelink) GetDirectUploadInfo added in v4.2.3

func (d *OnedriveSharelink) GetDirectUploadInfo(ctx context.Context, tool string, dstDir model.Obj, fileName string, fileSize int64) (any, error)

func (*OnedriveSharelink) GetDirectUploadTools added in v4.2.3

func (d *OnedriveSharelink) GetDirectUploadTools() []string

func (*OnedriveSharelink) Init

func (d *OnedriveSharelink) Init(ctx context.Context) error
func (d *OnedriveSharelink) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*OnedriveSharelink) List

func (d *OnedriveSharelink) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*OnedriveSharelink) MakeDir

func (d *OnedriveSharelink) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

func (*OnedriveSharelink) Move

func (d *OnedriveSharelink) Move(ctx context.Context, srcObj, dstDir model.Obj) error

func (*OnedriveSharelink) Put

func (*OnedriveSharelink) Remove

func (d *OnedriveSharelink) Remove(ctx context.Context, obj model.Obj) error

func (*OnedriveSharelink) Rename

func (d *OnedriveSharelink) Rename(ctx context.Context, srcObj model.Obj, newName string) error

Jump to

Keyboard shortcuts

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