Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: [#133] Add some methods to contracts/filesystem::File #119

Merged
merged 3 commits into from
May 24, 2023

Conversation

hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented May 23, 2023

Close: goravel/goravel#130

Add new methods:

type File interface {
  LastModified() (time.Time, error)
  MimeType() (string, error)
  Size() (int64, error)
}

Comment on lines +108 to 114
func (f *File) Store(path string) (string, error) {
return facades.Storage.Disk(f.disk).PutFile(path, f)
}

func (f *File) StoreAs(path string, name string) (string, error) {
return facades.Storage.Disk(f.disk).PutFileAs(path, f, name)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just move here.

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Patch coverage: 39.70% and project coverage change: +0.11 🎉

Comparison is base (9d7896d) 52.95% compared to head (3a20c8f) 53.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   52.95%   53.06%   +0.11%     
==========================================
  Files         105      105              
  Lines        7558     7570      +12     
==========================================
+ Hits         4002     4017      +15     
+ Misses       3277     3268       -9     
- Partials      279      285       +6     
Impacted Files Coverage Δ
filesystem/local.go 0.00% <0.00%> (ø)
http/gin_request.go 0.00% <0.00%> (ø)
filesystem/file.go 53.33% <36.84%> (-5.93%) ⬇️
support/file/file.go 44.18% <44.44%> (+5.85%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hwbrzzl hwbrzzl enabled auto-merge (squash) May 23, 2023 23:34
Copy link
Member

@devhaozi devhaozi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hwbrzzl hwbrzzl merged commit 889aef1 into master May 24, 2023
@hwbrzzl hwbrzzl deleted the bowen/#133 branch May 24, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ [Feature] Add some methods to contracts/filesystem::File
2 participants