Documentation ¶
Index ¶
- type Application
- type Client
- func (c *Client) AuthCodeURL(state string) string
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DriveList() (*DriveList, error)
- func (c *Client) FsDownload(path string, opt ...FsOptionFunc) (string, error)
- func (c *Client) FsGet(path string, opt ...FsOptionFunc) (*FsGet, error)
- func (c *Client) FsList(path string, opt ...FsOptionFunc) (*FsList, error)
- func (c *Client) GetToken(code string) (*oauth2.Token, error)
- func (c *Client) GetUserInfo() (*MicrosoftUserInfo, error)
- func (c *Client) Login(code string) error
- func (c *Client) NewRequest(method, relative string, data any) (req *http.Request, err error)
- func (c *Client) SetToken(tk oauth2.Token)
- func (c *Client) Token() (*oauth2.Token, error)
- type ClientOption
- type CreatedBy
- type Device
- type DriveList
- type File
- type FileSystemInfo
- type Folder
- type FsGet
- type FsList
- type FsOption
- type FsOptionFunc
- type Hashes
- type LastModifiedBy
- type MicrosoftError
- type MicrosoftUserInfo
- type OneDriveSync
- type ParentReference
- type Reactions
- type SpecialFolder
- type User
- type Value
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(clientID, clientSecret, redirectURL string, opt ...ClientOption) *Client
func (*Client) AuthCodeURL ¶
func (*Client) FsDownload ¶
func (c *Client) FsDownload(path string, opt ...FsOptionFunc) (string, error)
func (*Client) GetUserInfo ¶
func (c *Client) GetUserInfo() (*MicrosoftUserInfo, error)
func (*Client) NewRequest ¶
type ClientOption ¶
type ClientOption func(*Client)
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
func WithContext ¶
func WithContext(ctx context.Context) ClientOption
func WithToken ¶
func WithToken(tk oauth2.Token) ClientOption
type CreatedBy ¶
type CreatedBy struct { Application Application `json:"application"` Device Device `json:"device"` User User `json:"user"` OneDriveSync OneDriveSync `json:"oneDriveSync"` }
type FileSystemInfo ¶
type FsGet ¶ added in v0.3.3
type FsGet struct { CreatedBy struct { User struct { ID string `json:"id"` DisplayName string `json:"displayName"` } `json:"user"` } `json:"createdBy"` CreatedDateTime time.Time `json:"createdDateTime"` CTag string `json:"cTag"` ETag string `json:"eTag"` Folder struct { ChildCount int `json:"childCount"` } `json:"folder"` ID string `json:"id"` LastModifiedBy struct { User struct { ID string `json:"id"` DisplayName string `json:"displayName"` } `json:"user"` } `json:"lastModifiedBy"` LastModifiedDateTime time.Time `json:"lastModifiedDateTime"` Name string `json:"name"` Root struct{} `json:"root"` Size int `json:"size"` WebURL string `json:"webUrl"` }
type FsOptionFunc ¶
type FsOptionFunc func(*FsOption)
func WithDriveID ¶
func WithDriveID(driveID string) FsOptionFunc
type LastModifiedBy ¶
type LastModifiedBy struct { Application Application `json:"application"` Device Device `json:"device"` User User `json:"user"` OneDriveSync OneDriveSync `json:"oneDriveSync"` }
type MicrosoftError ¶ added in v0.3.3
type MicrosoftUserInfo ¶ added in v0.3.3
type MicrosoftUserInfo struct { OdataContext string `json:"@odata.context"` UserPrincipalName string `json:"userPrincipalName"` ID string `json:"id"` DisplayName string `json:"displayName"` Surname string `json:"surname"` GivenName string `json:"givenName"` PreferredLanguage string `json:"preferredLanguage"` Mail string `json:"mail"` }
type OneDriveSync ¶
type ParentReference ¶
type SpecialFolder ¶
type SpecialFolder struct {
Name string `json:"name"`
}
type Value ¶
type Value struct { CreatedDateTime time.Time `json:"createdDateTime"` CTag string `json:"cTag"` ETag string `json:"eTag"` ID string `json:"id"` LastModifiedDateTime time.Time `json:"lastModifiedDateTime"` Name string `json:"name"` Size int `json:"size"` WebURL string `json:"webUrl"` Reactions Reactions `json:"reactions"` CreatedBy CreatedBy `json:"createdBy,omitempty"` LastModifiedBy LastModifiedBy `json:"lastModifiedBy,omitempty"` ParentReference ParentReference `json:"parentReference"` FileSystemInfo FileSystemInfo `json:"fileSystemInfo"` Folder Folder `json:"folder,omitempty"` SpecialFolder SpecialFolder `json:"specialFolder,omitempty"` MicrosoftGraphDownloadURL string `json:"@microsoft.graph.downloadUrl,omitempty"` File File `json:"file,omitempty"` }
Click to show internal directories.
Click to hide internal directories.