PutFile is convenience function to put a file into an object store.
(file string, opts ...ObjectOpt)
| 882 | |
| 883 | // PutFile is convenience function to put a file into an object store. |
| 884 | func (obs *obs) PutFile(file string, opts ...ObjectOpt) (*ObjectInfo, error) { |
| 885 | f, err := os.Open(file) |
| 886 | if err != nil { |
| 887 | return nil, err |
| 888 | } |
| 889 | defer f.Close() |
| 890 | return obs.Put(&ObjectMeta{Name: file}, f, opts...) |
| 891 | } |
| 892 | |
| 893 | // GetFile is a convenience function to pull and object and place in a file. |
| 894 | func (obs *obs) GetFile(name, file string, opts ...GetObjectOpt) error { |