Documentation
¶
Index ¶
- type ChangeSource
- type Option
- func WithClientID(id string) Option
- func WithDriveName(name string) Option
- func WithExcludePatterns(patterns []string) Option
- func WithLogger(w io.Writer) Option
- func WithResolver(r *secretref.Resolver) Option
- func WithRootPath(path string) Option
- func WithTokenPath(path string) Option
- func WithTokenRef(ref string) Option
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeSource ¶
type ChangeSource struct {
Source
}
ChangeSource is an IncrementalSource backed by the Microsoft Graph delta API. It embeds Source to reuse authentication, full Walk, GetFileStream, and metadata conversion.
func NewChangeSource ¶
func NewChangeSource(ctx context.Context, opts ...Option) (*ChangeSource, error)
func (*ChangeSource) GetStartPageToken ¶
func (s *ChangeSource) GetStartPageToken() (string, error)
GetStartPageToken returns the current head of the OneDrive delta stream by requesting a "latest" delta token. The returned string is a full deltaLink URL.
func (*ChangeSource) Info ¶
func (s *ChangeSource) Info() source.SourceInfo
func (*ChangeSource) WalkChanges ¶
func (s *ChangeSource) WalkChanges(ctx context.Context, token string, callback func(source.FileChange) error) (string, error)
WalkChanges iterates over all changes since the given delta token. Folder changes are emitted before file changes so that the engine can resolve parent references incrementally. Returns the new delta token for the next run.
type Option ¶
type Option func(*oneDriveOptions)
Option configures a OneDrive source.
func WithClientID ¶
WithClientID sets the OAuth client ID. If empty, uses the built-in default.
func WithDriveName ¶
WithDriveName sets the shared drive name.
func WithExcludePatterns ¶
WithExcludePatterns sets the patterns used to exclude files and folders.
func WithLogger ¶
WithLogger sends this source's debug output to w.
Sources are constructed independently of a client, so a client's sink cannot reach them; this is how a caller supplies one (RFC 0022 §8).
func WithResolver ¶
WithResolver sets the secret resolver for ref-based auth.
func WithRootPath ¶
WithRootPath sets the path to the root folder.
func WithTokenPath ¶
WithTokenPath sets the path where the OAuth token is cached.
func WithTokenRef ¶
WithTokenRef sets the secret reference where the OAuth token is cached.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) GetFileStream ¶
func (s *Source) GetFileStream(fileID string) (io.ReadCloser, error)
func (*Source) Info ¶
func (s *Source) Info() source.SourceInfo