filesystem.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Package filesystem provides the Chrome DevTools Protocol
  2. // commands, types, and events for the FileSystem domain.
  3. //
  4. // Generated by the cdproto-gen command.
  5. package filesystem
  6. // Code generated by cdproto-gen. DO NOT EDIT.
  7. import (
  8. "context"
  9. "github.com/chromedp/cdproto/cdp"
  10. )
  11. // GetDirectoryParams [no description].
  12. type GetDirectoryParams struct {
  13. BucketFileSystemLocator *BucketFileSystemLocator `json:"bucketFileSystemLocator"`
  14. }
  15. // GetDirectory [no description].
  16. //
  17. // See: https://chromedevtools.github.io/devtools-protocol/tot/FileSystem#method-getDirectory
  18. //
  19. // parameters:
  20. //
  21. // bucketFileSystemLocator
  22. func GetDirectory(bucketFileSystemLocator *BucketFileSystemLocator) *GetDirectoryParams {
  23. return &GetDirectoryParams{
  24. BucketFileSystemLocator: bucketFileSystemLocator,
  25. }
  26. }
  27. // GetDirectoryReturns return values.
  28. type GetDirectoryReturns struct {
  29. Directory *Directory `json:"directory,omitempty,omitzero"` // Returns the directory object at the path.
  30. }
  31. // Do executes FileSystem.getDirectory against the provided context.
  32. //
  33. // returns:
  34. //
  35. // directory - Returns the directory object at the path.
  36. func (p *GetDirectoryParams) Do(ctx context.Context) (directory *Directory, err error) {
  37. // execute
  38. var res GetDirectoryReturns
  39. err = cdp.Execute(ctx, CommandGetDirectory, p, &res)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return res.Directory, nil
  44. }
  45. // Command names.
  46. const (
  47. CommandGetDirectory = "FileSystem.getDirectory"
  48. )