Documentation
¶
Index ¶
- Variables
- func IsHTTPStatusOK(status int) bool
- func UnmarshalJSON(o interface{}, body []byte) error
- type Client
- func (client *Client) CreateDir(path string) error
- func (client *Client) Delete(path string) error
- func (client *Client) Download(sourceFilePath, targetFolder string) error
- func (client *Client) GetLoginURL() string
- func (client *Client) Info(path string) (*DriveItem, error)
- func (client *Client) List(path string) ([]*DriveItem, error)
- func (client *Client) Login() error
- func (client *Client) RenewAccessToken() (*LoginRedeemCodeResponse, error)
- func (client *Client) ResetChannels()
- func (client *Client) ShouldRenewAccessToken() bool
- func (client *Client) UpdateSecretStore(grant *LoginRedeemCodeResponse) error
- func (client *Client) Upload(localFilePath, targetFolder string) error
- type Config
- type CreateFolderRequest
- type DownloadFileStat
- type DriveItem
- type DriveItemType
- type EmptyStruct
- type ErrorResponse
- type ErrorType
- type FileHashes
- type FileItem
- type FileSystemInfo
- type FolderItem
- type FolderProperties
- type HTTPRequestParams
- type ListResponse
- type LoginRedeemCodeResponse
- type ProgressReader
- type UploadSessionResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UploadSessionFileSizeLimit int = 4 * 1000 * 1000 // 4 MB UploadSessionMultiple int = 320 * 1024 // 320 KB UploadSessionRangeSize int = UploadSessionMultiple * 10 )
View Source
var (
GraphURL = "https://graph.microsoft.com/v1.0/"
)
Functions ¶
func IsHTTPStatusOK ¶ added in v0.4.1
func UnmarshalJSON ¶
Types ¶
type Client ¶
type Client struct {
Config *Config
Verbose bool
UseTransferSignals bool
ChannelTransferStart chan fs.FileInfo
ChannelTransferProgress chan int64
ChannelTransferFinish chan bool
}
func CreateClient ¶
func (*Client) GetLoginURL ¶
func (*Client) RenewAccessToken ¶
func (client *Client) RenewAccessToken() (*LoginRedeemCodeResponse, error)
func (*Client) ResetChannels ¶ added in v0.5.0
func (client *Client) ResetChannels()
func (*Client) ShouldRenewAccessToken ¶
func (*Client) UpdateSecretStore ¶
func (client *Client) UpdateSecretStore(grant *LoginRedeemCodeResponse) error
type Config ¶
type Config struct {
ConfigFilePath string `json:"-"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Scopes []string `json:"scopes"`
RedirectURL string `json:"redirect_uri"`
Root string `json:"root"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
Expiry time.Time `json:"expiry"`
SecretStore string `json:"secret_store,omitempty"`
}
func ReadConfig ¶
func ReadConfigData ¶ added in v0.4.3
type CreateFolderRequest ¶
type CreateFolderRequest struct {
Name string `json:"name"`
Folder FolderProperties `json:"folder"`
ConflictBehavior string `json:"@microsoft.graph.conflictBehavior"`
}
type DownloadFileStat ¶ added in v0.5.0
func (*DownloadFileStat) IsDir ¶ added in v0.5.0
func (s *DownloadFileStat) IsDir() bool
func (*DownloadFileStat) ModTime ¶ added in v0.5.0
func (s *DownloadFileStat) ModTime() time.Time
func (*DownloadFileStat) Mode ¶ added in v0.5.0
func (s *DownloadFileStat) Mode() fs.FileMode
func (*DownloadFileStat) Name ¶ added in v0.5.0
func (s *DownloadFileStat) Name() string
func (*DownloadFileStat) Size ¶ added in v0.5.0
func (s *DownloadFileStat) Size() int64
func (*DownloadFileStat) Sys ¶ added in v0.5.0
func (s *DownloadFileStat) Sys() any
type DriveItem ¶
type DriveItem struct {
Name string `json:"name"`
SizeBytes int64 `json:"size"`
File FileItem `json:"file"`
Folder FolderItem `json:"folder"`
FileSystemInfo FileSystemInfo `json:"fileSystemInfo"`
Type DriveItemType
}
type DriveItemType ¶ added in v0.4.6
type DriveItemType int
const ( DriveItemTypeFile DriveItemType = 1 DriveItemTypeFolder DriveItemType = 2 )
type EmptyStruct ¶
type EmptyStruct struct{}
type ErrorResponse ¶ added in v0.4.5
type ErrorResponse struct {
Error ErrorType `json:"error"`
}
type FileHashes ¶ added in v0.4.0
type FileItem ¶
type FileItem struct {
MimeType string `json:"mimeType"`
Hashes FileHashes `json:"hashes"`
}
type FileSystemInfo ¶ added in v0.4.0
type FolderItem ¶
type FolderItem struct {
ChildCount int `json:"childCount"`
}
type FolderProperties ¶
type FolderProperties struct {
}
type HTTPRequestParams ¶
type ListResponse ¶
type LoginRedeemCodeResponse ¶
type ProgressReader ¶ added in v0.5.0
func (*ProgressReader) Close ¶ added in v0.5.0
func (r *ProgressReader) Close() error
func (*ProgressReader) Len ¶ added in v0.5.0
func (r *ProgressReader) Len() int
type UploadSessionResponse ¶
Click to show internal directories.
Click to hide internal directories.