Documentation
¶
Index ¶
- type Storage
- func (s *Storage) CreateBucket(id bucket.ID, trashTime time.Time) (path string, commit, abort func() error, err error)
- func (s *Storage) CreateFile(bucketID bucket.ID, file string) (path string, commit, abort func() error, err error)
- func (s *Storage) DeleteFile(bucketID bucket.ID, file string) error
- func (s *Storage) DownloadBucket(ctx context.Context, endpoint string, id bucket.ID, trashTime time.Time) error
- func (s *Storage) DownloadFile(ctx context.Context, endpoint string, bucketID bucket.ID, file string) error
- func (s *Storage) GetBucket(id bucket.ID) (path string, unlock func(), err error)
- func (s *Storage) GetBucketMeta(id bucket.ID) (meta BucketMeta, err error)
- func (s *Storage) GetFile(bucketID bucket.ID, file string) (path string, unlock func(), err error)
- func (s *Storage) RemoveBucket(id bucket.ID) (err error)
- func (s *Storage) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) CreateBucket ¶ added in v1.0.0
func (s *Storage) CreateBucket( id bucket.ID, trashTime time.Time, ) (path string, commit, abort func() error, err error)
CreateBucket Создаёт бакет id Бакет создаётся во временной директории; path - абсолютный путь временной директории При вызове функции commit() он перемещается в storage При вызове функции abort() он удаляется
func (*Storage) CreateFile ¶ added in v0.5.0
func (s *Storage) CreateFile(bucketID bucket.ID, file string) (path string, commit, abort func() error, err error)
CreateFile Создаёт файл file в существующем бакете bucketID Файл создаётся во временной директории; path - абсолютный путь до временной директории При вызове функции commit() он перемещается в storage При вызове функции abort() он удаляется
func (*Storage) DeleteFile ¶ added in v0.6.1
func (*Storage) DownloadBucket ¶ added in v1.0.0
func (s *Storage) DownloadBucket( ctx context.Context, endpoint string, id bucket.ID, trashTime time.Time, ) error
DownloadBucket Скачивает бакет id с указанного endpoint
func (*Storage) DownloadFile ¶ added in v0.4.0
func (s *Storage) DownloadFile( ctx context.Context, endpoint string, bucketID bucket.ID, file string, ) error
DownloadFile Скачивает файл file в существующий бакет bucketID с указанного endpoint
func (*Storage) GetBucket ¶ added in v1.0.0
GetBucket Возвращает абсолютный путь бакета id Бакет блокируется в режиме на чтение. Для разблокировки необходимо вызвать unlock()
func (*Storage) GetBucketMeta ¶ added in v1.0.0
GetBucketMeta Возвращает метаинформацию о бакете id
func (*Storage) GetFile ¶ added in v1.1.0
GetFile Возвращает абсолютный путь бакета bucketID, в котором лежит файл file Бакет блокируется в режиме на чтение. Для разблокировки необходимо вызвать unlock()
func (*Storage) RemoveBucket ¶ added in v1.0.0
RemoveBucket Удаляет бакет id