Documentation ¶
Index ¶
- Constants
- type Options
- func (opt *Options) BuildDefaultFileKey(pubKey string)
- func (opt *Options) BuildDefaultOwnerPriv(ownerPriv *ecdsa.PrivateKey)
- func (opt *Options) BuildDownloadMaximumSize(size int64)
- func (opt *Options) BuildDownloadPath(path string)
- func (opt *Options) BuildLocalStorage(isEnable bool)
- func (opt *Options) BuildMaxSliceSize(maxSliceSize int64) error
- func (opt *Options) BuildMaxUploadSize(size int64)
- func (opt *Options) BuildMinSliceSize(minSliceSize int64) error
- func (opt *Options) BuildMinUploadSize(size int64)
- func (opt *Options) BuildRootPath(path string)
- func (opt *Options) BuildRoutingTableLow(low int64)
- func (opt *Options) BuildShardsOptions(dataShards, parityShards int64) error
- func (opt *Options) BuildSizeAndRatioOptions(shardSize int64, parityRatio float64) error
- func (opt *Options) BuildStorageMode(storageMode StorageMode)
- func (opt *Options) GetDataShards() int64
- func (opt *Options) GetDefaultBufSize() int64
- func (opt *Options) GetDefaultFileKey() string
- func (opt *Options) GetDefaultOwnerPriv() *ecdsa.PrivateKey
- func (opt *Options) GetDownloadMaximumSize() int64
- func (opt *Options) GetDownloadPath() string
- func (opt *Options) GetLocalStorage() bool
- func (opt *Options) GetMaxBufferSize() int64
- func (opt *Options) GetMaxRetries() int64
- func (opt *Options) GetMaxSliceSize() int64
- func (opt *Options) GetMaxUploadSize() int64
- func (opt *Options) GetMaxXrefTable() int64
- func (opt *Options) GetMinSliceSize() int64
- func (opt *Options) GetMinUploadSize() int64
- func (opt *Options) GetParityRatio() float64
- func (opt *Options) GetParityShards() int64
- func (opt *Options) GetRetryInterval() time.Duration
- func (opt *Options) GetRootPath() string
- func (opt *Options) GetRoutingTableLow() int64
- func (opt *Options) GetShardSize() int64
- func (opt *Options) GetShardsOptions() (int64, int64, bool)
- func (opt *Options) GetSizeAndRatioOptions() (int64, float64, bool)
- func (opt *Options) GetStorageMode() StorageMode
- type StorageMode
Constants ¶
const ( DbFile = "database.db" Version = "0.0.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options 是用于创建文件存储对象的参数
func (*Options) BuildDefaultFileKey ¶
BuildDefaultFileKey 设置默认文件密钥
func (*Options) BuildDefaultOwnerPriv ¶
func (opt *Options) BuildDefaultOwnerPriv(ownerPriv *ecdsa.PrivateKey)
BuildDefaultOwnerPriv 设置默认所有者的私钥
func (*Options) BuildDownloadMaximumSize ¶ added in v1.0.0
BuildDownloadMaximumSize 设置下载最大回复大小
func (*Options) BuildDownloadPath ¶
BuildDownloadPath 设置下载路径
func (*Options) BuildLocalStorage ¶
BuildLocalStorage 设置是否启动本地存储选项
func (*Options) BuildMaxSliceSize ¶
BuildMaxSliceSize 设置最大切片的大小选项
func (*Options) BuildMaxUploadSize ¶ added in v1.0.0
BuildMaxUploadSize 设置最大上传大小
func (*Options) BuildMinSliceSize ¶
BuildMinSliceSize 设置最小切片的大小
func (*Options) BuildMinUploadSize ¶ added in v1.0.0
BuildMinUploadSize 设置最小上传大小
func (*Options) BuildRootPath ¶
BuildRootPath 设置文件根路径
func (*Options) BuildRoutingTableLow ¶
BuildRoutingTableLow 设置路由表中连接的最小节点数量
func (*Options) BuildShardsOptions ¶
BuildShardsOptions 设置奇偶分片大小选项
func (*Options) BuildSizeAndRatioOptions ¶
BuildSizeAndRatioOptions 设置奇偶分片比例选项 shardSize 以字节为单位
func (*Options) BuildStorageMode ¶
func (opt *Options) BuildStorageMode(storageMode StorageMode)
BuildStorageMode 设置存储模式
func (*Options) GetDefaultBufSize ¶
GetDefaultBufSize 获取常用缓冲区的大小
func (*Options) GetDefaultFileKey ¶
GetDefaultFileKey 获取默认文件密钥
func (*Options) GetDefaultOwnerPriv ¶
func (opt *Options) GetDefaultOwnerPriv() *ecdsa.PrivateKey
GetDefaultOwnerPriv 获取默认所有者的私钥
func (*Options) GetDownloadMaximumSize ¶ added in v1.0.0
GetDownloadMaximumSize 获取下载最大回复大小
func (*Options) GetDownloadPath ¶
GetDownloadPath 获取下载路径
func (*Options) GetLocalStorage ¶
GetLocalStorage 获取是否开启本地存储,上传成功后保留本地文件片段
func (*Options) GetMaxBufferSize ¶
GetMaxBufferSize 获取最大缓冲区的大小
func (*Options) GetMaxSliceSize ¶
GetMaxSliceSize 获取最大片段的大小
func (*Options) GetMaxUploadSize ¶ added in v1.0.0
GetMaxUploadSize 获取最大上传大小
func (*Options) GetMaxXrefTable ¶
GetMaxXrefTable 获取Xref表中段的最大数量
func (*Options) GetMinSliceSize ¶
GetMinSliceSize 获取最小片段的大小
func (*Options) GetMinUploadSize ¶ added in v1.0.0
GetMinUploadSize 获取最小上传大小
func (*Options) GetParityRatio ¶
GetParityRatio 获取奇偶校验片段占比
func (*Options) GetParityShards ¶
GetParityShards 获取奇偶校验片段的数量
func (*Options) GetRetryInterval ¶
GetRetryInterval 获取重试间隔
func (*Options) GetRoutingTableLow ¶
GetRoutingTableLow 获取路由表中连接的最小节点数量
func (*Options) GetShardsOptions ¶
GetShardsOptions 获取奇偶分片大小选项
func (*Options) GetSizeAndRatioOptions ¶
GetSizeAndRatioOptions 获取奇偶分片比例选项
func (*Options) GetStorageMode ¶
func (opt *Options) GetStorageMode() StorageMode
GetStorageMode 获取存储模式
type StorageMode ¶
type StorageMode int
存储模式
const ( FileMode StorageMode = iota // 文件模式 SliceMode // 切片模式,将文件分割成有限个切片(不使用纠删码) RS_Size // 纠删码(大小)模式 RS_Proportion // 纠删码(比例)模式 )