Documentation
¶
Index ¶
- Constants
- Variables
- func WebsiteAccount(ctx context.Context, call WebsiteCall) (string, error)
- type Driver
- func (d *Driver) Close() error
- func (d *Driver) Enumerate(ctx context.Context, q core.NativeQuery) (core.Iterator, error)
- func (d *Driver) Open(ctx context.Context, address core.NativeAddress, options core.OpenOptions) (core.Opened, error)
- func (d *Driver) Remove(ctx context.Context, p core.NativeAddress, options ...core.RemoveOptions) (core.Change, error)
- func (d *Driver) RemoveWithDisposition(ctx context.Context, target core.NativeAddress, options core.RemoveOptions) (core.Change, error)
- func (d *Driver) RootID() string
- func (d *Driver) Stat(ctx context.Context, address core.NativeAddress, ...) (core.Metadata, error)
- type WebsiteCall
- type WebsiteOptions
Constants ¶
const WebsiteURL = websiteOrigin + "/"
WebsiteURL is the page where a user signs in to UC Cloud Drive.
Variables ¶
var ( ErrWebsiteSignIn = errors.New("the UC website needs sign-in") ErrWebsiteBindingMismatch = errors.New("the UC website account or folder changed") )
Functions ¶
func WebsiteAccount ¶
func WebsiteAccount(ctx context.Context, call WebsiteCall) (string, error)
WebsiteAccount verifies the account in the authenticated page.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver exposes an authenticated UC folder.
func OpenWebsite ¶
func OpenWebsite(ctx context.Context, o WebsiteOptions) (*Driver, error)
OpenWebsite checks the bound account, root identity and first native page.
func (*Driver) Open ¶
func (d *Driver) Open(ctx context.Context, address core.NativeAddress, options core.OpenOptions) (core.Opened, error)
func (*Driver) Remove ¶ added in v0.2.0
func (d *Driver) Remove(ctx context.Context, p core.NativeAddress, options ...core.RemoveOptions) (core.Change, error)
func (*Driver) RemoveWithDisposition ¶ added in v0.2.0
func (d *Driver) RemoveWithDisposition(ctx context.Context, target core.NativeAddress, options core.RemoveOptions) (core.Change, error)
type WebsiteCall ¶
type WebsiteCall = func(context.Context, string, json.RawMessage) (json.RawMessage, error)
WebsiteCall evaluates a UC page function with one JSON argument.
type WebsiteOptions ¶
type WebsiteOptions struct {
Tab context.Context
Call WebsiteCall
Account string
RootPath, RootID string
Release func() error
// Origin and GrantEndpoint override the download endpoints for loopback fixtures.
Origin, GrantEndpoint string
}
WebsiteOptions binds an authenticated page to a selected UC folder. The caller retains the page on failure. The Driver owns Release on success.