Documentation ¶
Overview ¶
Copyright 2020 duyanghao
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 duyanghao ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 duyanghao ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Config
- type Option
- type Storage
- func (fs *Storage) CreateWithMetaInfo(name string, info *metainfo.MetaInfo) error
- func (fs *Storage) Delete(name string) error
- func (fs *Storage) Download(name string) ([]byte, error)
- func (fs *Storage) GetDataDir() string
- func (fs *Storage) GetFilePath(id string) string
- func (fs *Storage) GetTorrentDir() string
- func (fs *Storage) GetTorrentFilePath(id string) string
- func (fs *Storage) List(prefix string) ([]*backend.FileInfo, error)
- func (fs *Storage) Stat(name string) (*backend.FileInfo, error)
- func (fs *Storage) Upload(name string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RootDirectory string `yaml:"rootDirectory"` // filesystem root directory
}
Config defines filesystem specific parameters and authetication credentials
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Client implements a backend.Storage for FileSystem.
func NewStorage ¶
NewStorage creates a new Storage for file system.
func (*Storage) CreateWithMetaInfo ¶
Create creates name and returns io.Writer
func (*Storage) GetDataDir ¶
func (*Storage) GetFilePath ¶
GetFilePath returns data file path
func (*Storage) GetTorrentDir ¶
func (*Storage) GetTorrentFilePath ¶
GetTorrentFilePath returns torrent file path