Documentation ¶
Index ¶
- Variables
- func GetPriceAndMinStorageLength(params *ContextParams) (price int64, storageLength int, err error)
- func GetShardHashes(params *ContextParams, fileHash string) (shardHashes []string, fileSize int64, shardSize int64, err error)
- func GetShardHashesCopy(params *ContextParams, fileHash string, copyNum int) (shardHashes []string, fileSize int64, shardSize int64, err error)
- func NewContractID(sessionId string) string
- func SplitContractId(contractId string) (ssId string, shardHash string)
- func TotalPay(shardSize int64, price int64, storageLength int, rate *big.Int) (int64, error)
- func TotalPayReal(shardSize int64, price int64, storageLength int, rate *big.Int) (int64, error)
- func TotalPayRound(shardSize int64, price int64, storageLength int, rate *big.Int) (int64, error)
- type ContextParams
- type CustomizedHostsProvider
- type HostsProvider
- type IHostsProvider
- type Peers
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EscrowChanMaps = cmap.New() EscrowContractMaps = cmap.New() GuardChanMaps = cmap.New() GuardContractMaps = cmap.New() BalanceChanMaps = cmap.New() UnsignedChannelCommitMaps = cmap.New() SignedChannelCommitChanMaps = cmap.New() PayinReqChanMaps = cmap.New() FileMetaChanMaps = cmap.New() QuestionsChanMaps = cmap.New() WaitUploadChanMap = cmap.New() )
View Source
var ( WaitUploadBo = func(maxTime time.Duration) *backoff.ExponentialBackOff { bo := backoff.NewExponentialBackOff() bo.InitialInterval = 10 * time.Second bo.MaxElapsedTime = maxTime bo.Multiplier = 1.5 bo.MaxInterval = 10 * time.Minute return bo } HandleShardBo = func() *backoff.ExponentialBackOff { bo := backoff.NewExponentialBackOff() bo.InitialInterval = 1 * time.Second bo.MaxElapsedTime = 300 * time.Second bo.Multiplier = 1 bo.MaxInterval = 1 * time.Second return bo }() CheckPaymentBo = func() *backoff.ExponentialBackOff { bo := backoff.NewExponentialBackOff() bo.InitialInterval = 10 * time.Second bo.MaxElapsedTime = 5 * time.Minute bo.Multiplier = 1.5 bo.MaxInterval = 60 * time.Second return bo }() DownloadShardBo = func(maxTime time.Duration) *backoff.ExponentialBackOff { bo := backoff.NewExponentialBackOff() bo.InitialInterval = 10 * time.Second bo.MaxElapsedTime = maxTime bo.Multiplier = 1.5 bo.MaxInterval = 30 * time.Minute return bo } WaitingForPeersBo = func() *backoff.ExponentialBackOff { bo := backoff.NewExponentialBackOff() bo.InitialInterval = 1 * time.Second bo.MaxElapsedTime = 300 * time.Second bo.Multiplier = 1.2 bo.MaxInterval = 5 * time.Second return bo }() )
Functions ¶
func GetPriceAndMinStorageLength ¶
func GetPriceAndMinStorageLength(params *ContextParams) (price int64, storageLength int, err error)
func GetShardHashes ¶
func GetShardHashesCopy ¶
func NewContractID ¶
func SplitContractId ¶
func TotalPayReal ¶
Types ¶
type ContextParams ¶
type ContextParams struct { Req *cmds.Request Env cmds.Environment Ctx context.Context N *core.IpfsNode Cfg *config.Config Api iface.CoreAPI }
func ExtractContextParams ¶
func ExtractContextParams(req *cmds.Request, env cmds.Environment) (*ContextParams, error)
type CustomizedHostsProvider ¶
func (*CustomizedHostsProvider) AddIndex ¶
func (p *CustomizedHostsProvider) AddIndex() (int, error)
func (*CustomizedHostsProvider) NextValidHost ¶
func (p *CustomizedHostsProvider) NextValidHost() (string, error)
type HostsProvider ¶
func (*HostsProvider) AddIndex ¶
func (p *HostsProvider) AddIndex() (int, error)
func (*HostsProvider) NextValidHost ¶
func (p *HostsProvider) NextValidHost() (string, error)
func (*HostsProvider) PickFromBackupHosts ¶
func (p *HostsProvider) PickFromBackupHosts() (string, error)
type IHostsProvider ¶
func GetCustomizedHostsProvider ¶
func GetCustomizedHostsProvider(cp *ContextParams, hosts []string) IHostsProvider
func GetHostsProvider ¶
func GetHostsProvider(cp *ContextParams, blacklist []string) IHostsProvider
Click to show internal directories.
Click to hide internal directories.