Documentation
¶
Index ¶
- type FileInfo
- type Store
- func (s *Store) Clean(lifetime time.Duration) error
- func (s *Store) Create(prefix string, r io.Reader) (*FileInfo, error)
- func (s *Store) GetFullName(prefix, name string) string
- func (s *Store) IsExists(prefix, name string) bool
- func (s *Store) Open(prefix, name string) (*os.File, error)
- func (s *Store) Remove(prefix, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct {
Location string `json:"location"`
Name string `json:"name"`
Mimetype string `json:"mimetype"`
Size int64 `json:"size"`
CRC32 uint32 `json:"crc32"`
MD5 string `json:"md5"`
}
FileInfo описывает информацию о сохраненном файле.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store описывает хранилище файлов.
func (*Store) Create ¶
Create сохраняет файл в хранилище. В качестве имени файла используется комбинация из двух хешей. Файл сохраняется в подкаталоге prefix, если он задан, но данный prefix не учитывается в возвращаемой информации в имени файла.
func (*Store) GetFullName ¶
GetFullName возвращает полный путь к файлу в хранилище.
Click to show internal directories.
Click to hide internal directories.