onedrive_sharelink

package
v3.39.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: AGPL-3.0 Imports: 21 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"`
	IsSharepoint      bool

	Headers    http.Header
	HeaderTime 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.
}

Item represents an individual item in the folder.

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) 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