graph

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP *http.Client
	Base string
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) DeleteByPath

func (c *Client) DeleteByPath(ctx context.Context, relPath string) error

func (*Client) DownloadTo

func (c *Client) DownloadTo(ctx context.Context, itemID, destPath string) error

func (*Client) GetItemByPath

func (c *Client) GetItemByPath(ctx context.Context, relPath string) (*DriveItem, error)

func (*Client) ListChildren added in v0.9.3

func (c *Client) ListChildren(ctx context.Context, relPath string) ([]DriveItem, error)

func (*Client) RootDelta

func (c *Client) RootDelta(ctx context.Context, deltaLink string) (*DeltaResponse, error)

func (*Client) UploadLarge

func (c *Client) UploadLarge(ctx context.Context, relPath, localPath, ifMatch string, chunkMB, parallel int) (*DriveItem, error)

func (*Client) UploadSmall

func (c *Client) UploadSmall(ctx context.Context, relPath, localPath, ifMatch string) (*DriveItem, error)

type DeltaGoneError added in v0.7.28

type DeltaGoneError struct{}

DeltaGoneError is returned when the OneDrive delta link has expired (HTTP 410 Gone). The caller must discard the stored delta link and restart from a full sync.

func (*DeltaGoneError) Error added in v0.7.28

func (e *DeltaGoneError) Error() string

type DeltaResponse

type DeltaResponse struct {
	Value     []DriveItem `json:"value"`
	DeltaLink string      `json:"@odata.deltaLink"`
	NextLink  string      `json:"@odata.nextLink"`
}

type DriveItem

type DriveItem struct {
	ID                   string                    `json:"id"`
	Name                 string                    `json:"name"`
	Size                 int64                     `json:"size"`
	ETag                 string                    `json:"eTag"`
	CTag                 string                    `json:"cTag"`
	LastModifiedDateTime string                    `json:"lastModifiedDateTime"`
	File                 *DriveItemFile            `json:"file"`
	Folder               *DriveItemFolder          `json:"folder"`
	ParentReference      *DriveItemParentReference `json:"parentReference"`
	Deleted              map[string]any            `json:"deleted"`
}

type DriveItemFile added in v0.9.3

type DriveItemFile struct {
	MimeType string           `json:"mimeType"`
	Hashes   *DriveItemHashes `json:"hashes"`
}

type DriveItemFolder added in v0.9.3

type DriveItemFolder struct {
	ChildCount int `json:"childCount"`
}

type DriveItemHashes added in v0.9.3

type DriveItemHashes struct {
	Sha256Hash string `json:"sha256Hash"`
}

type DriveItemParentReference added in v0.9.3

type DriveItemParentReference struct {
	Path string `json:"path"`
}

Jump to

Keyboard shortcuts

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