(r io.ReadSeeker, fileName string)
| 320 | } |
| 321 | |
| 322 | func NewStreamFile(r io.ReadSeeker, fileName string) *FileElement { |
| 323 | md5, sha1, length := crypto.ComputeMd5AndSha1AndLength(r) |
| 324 | return &FileElement{ |
| 325 | FileName: fileName, |
| 326 | FileSize: length, |
| 327 | FileStream: r, |
| 328 | FileMd5: md5, |
| 329 | FileSha1: sha1, |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | func NewLocalFile(path string, name ...string) (*FileElement, error) { |
| 334 | file, err := os.Open(path) |
no test coverage detected