Skip to content

Commit

Permalink
Merge pull request ipfs/go-ipfs-files#13 from jmank88/webfile-abspath
Browse files Browse the repository at this point in the history
return url as AbsPath from WebFile to implement FileInfo

This commit was moved from ipfs/go-ipfs-files@6b8782d
  • Loading branch information
Stebalien committed Mar 21, 2019
2 parents 4b7eabe + 880ae9f commit 9ea7640
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions files/webfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"net/http"
"net/url"
"os"
)

// WebFile is an implementation of File which reads it
Expand Down Expand Up @@ -61,4 +62,13 @@ func (wf *WebFile) Size() (int64, error) {
return wf.contentLength, nil
}

func (wf *WebFile) AbsPath() string {
return wf.url.String()
}

func (wf *WebFile) Stat() os.FileInfo {
return nil
}

var _ File = &WebFile{}
var _ FileInfo = &WebFile{}

0 comments on commit 9ea7640

Please sign in to comment.