upload

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseMicrosoftGraphAPIMeDrivecreateUploadSessionPath

func UseMicrosoftGraphAPIMeDrivecreateUploadSessionPath(str string) string

Types

type MicrosoftGraphAPI

type MicrosoftGraphAPI interface {
	UseMicrosoftGraphAPIGet(string) ([]byte, error)
	UseMicrosoftGraphAPIPost(string, io.Reader) ([]byte, error)
	UseMicrosoftGraphAPIPut(string, io.Reader) ([]byte, error)
}

type UploadSession

type UploadSession struct {
	UploadSessionDescription *UploadSessionDescription             `json:"uploadSessionDescription"`
	UploadSessionReference   *graphapi.MicrosoftGraphUploadSession `json:"uploadSessionReference"`
}

func NewUploadSession

func NewUploadSession(size int64, microsoftGraphUploadSession *graphapi.MicrosoftGraphUploadSession) (*UploadSession, error)

func NewUploadSessionsFromRange

func NewUploadSessionsFromRange(size int64, microsoftGraphUploadSession *graphapi.MicrosoftGraphUploadSession) ([]UploadSession, error)

func (*UploadSession) Put

type UploadSessionDescription

type UploadSessionDescription struct {
	Status        string                               `json:"status"`
	ContentLength int64                                `json:"contentLength"`
	ContentRange  UploadSessionDescriptionContentRange `json:"contentRange"`
}

ContentLength: 26

func (*UploadSessionDescription) GetContentChunkSize

func (usd *UploadSessionDescription) GetContentChunkSize() string

func (*UploadSessionDescription) GetContentChunkSizeInt64

func (usd *UploadSessionDescription) GetContentChunkSizeInt64() int64

func (*UploadSessionDescription) GetContentLength

func (usd *UploadSessionDescription) GetContentLength() string

func (*UploadSessionDescription) GetContentRange

func (usd *UploadSessionDescription) GetContentRange() string

func (*UploadSessionDescription) SetContentRangTo

func (usd *UploadSessionDescription) SetContentRangTo() int64

type UploadSessionDescriptionContentRange

type UploadSessionDescriptionContentRange struct {
	Type string `json:"type"`
	From int64  `json:"from"`
	To   int64  `json:"to"`
}

ContentRange: bytes 0-25/128

type Uploader

type Uploader struct {
	UploaderDescription *UploaderDescription `json:"uploaderDescription"`
	UploadSessions      []UploadSession      `json:"uploadSessions,omitempty"`
}

func NewUploader

func NewUploader(input *UploaderDescription) (*Uploader, error)

func (*Uploader) Close

func (u *Uploader) Close(api MicrosoftGraphAPI)

func (*Uploader) Copy

func (u *Uploader) Copy(api MicrosoftGraphAPI)

func (*Uploader) Start

func (u *Uploader) Start(api MicrosoftGraphAPI)

type UploaderCollection

type UploaderCollection struct {
	Uploaders []*Uploader `json:"uploaders"`
}

func (*UploaderCollection) Init

func (*UploaderCollection) Load

func (uc *UploaderCollection) Load(driveID string) error

func (*UploaderCollection) Save

func (uc *UploaderCollection) Save(driveID string) error

type UploaderDescription

type UploaderDescription struct {
	UploaderReference    *UploaderReference                                    `json:"uploaderReference"`
	UploadableProperties *graphapi.MicrosoftGraphDriveItemUploadableProperties `json:"uploadableProperties"`
}

type UploaderReference

type UploaderReference struct {
	DriveType string  `json:"driveType"` // personal, business, documentLibrary
	Name      string  `json:"name,omitempty"`
	Size      int64   `json:"size"`
	Path      string  `json:"path"`
	UploadURL *string `json:"uploadUrl"`
}

Jump to

Keyboard shortcuts

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