Fill fills in the function pointers in the Features struct from the optional interfaces. It returns the original updated Features struct passed in.
(ctx context.Context, f Fs)
| 292 | // optional interfaces. It returns the original updated Features |
| 293 | // struct passed in. |
| 294 | func (ft *Features) Fill(ctx context.Context, f Fs) *Features { |
| 295 | if do, ok := f.(Purger); ok { |
| 296 | ft.Purge = do.Purge |
| 297 | } |
| 298 | if do, ok := f.(Copier); ok { |
| 299 | ft.Copy = do.Copy |
| 300 | } |
| 301 | if do, ok := f.(Mover); ok { |
| 302 | ft.Move = do.Move |
| 303 | } |
| 304 | if do, ok := f.(DirMover); ok { |
| 305 | ft.DirMove = do.DirMove |
| 306 | } |
| 307 | if do, ok := f.(MkdirMetadataer); ok { |
| 308 | ft.MkdirMetadata = do.MkdirMetadata |
| 309 | } |
| 310 | if do, ok := f.(ChangeNotifier); ok { |
| 311 | ft.ChangeNotify = do.ChangeNotify |
| 312 | } |
| 313 | if do, ok := f.(UnWrapper); ok { |
| 314 | ft.UnWrap = do.UnWrap |
| 315 | } |
| 316 | if do, ok := f.(Wrapper); ok { |
| 317 | ft.WrapFs = do.WrapFs |
| 318 | ft.SetWrapper = do.SetWrapper |
| 319 | ft.Overlay = true // if implement UnWrap then must be an Overlay |
| 320 | } |
| 321 | if do, ok := f.(DirCacheFlusher); ok { |
| 322 | ft.DirCacheFlush = do.DirCacheFlush |
| 323 | } |
| 324 | if do, ok := f.(PublicLinker); ok { |
| 325 | ft.PublicLink = do.PublicLink |
| 326 | } |
| 327 | if do, ok := f.(PutUncheckeder); ok { |
| 328 | ft.PutUnchecked = do.PutUnchecked |
| 329 | } |
| 330 | if do, ok := f.(PutStreamer); ok { |
| 331 | ft.PutStream = do.PutStream |
| 332 | } |
| 333 | if do, ok := f.(MergeDirser); ok { |
| 334 | ft.MergeDirs = do.MergeDirs |
| 335 | } |
| 336 | if do, ok := f.(DirSetModTimer); ok { |
| 337 | ft.DirSetModTime = do.DirSetModTime |
| 338 | } |
| 339 | if do, ok := f.(CleanUpper); ok { |
| 340 | ft.CleanUp = do.CleanUp |
| 341 | } |
| 342 | if do, ok := f.(ListRer); ok { |
| 343 | ft.ListR = do.ListR |
| 344 | } |
| 345 | if do, ok := f.(ListPer); ok { |
| 346 | ft.ListP = do.ListP |
| 347 | } |
| 348 | if do, ok := f.(Abouter); ok { |
| 349 | ft.About = do.About |
| 350 | } |
| 351 | if do, ok := f.(OpenWriterAter); ok { |