Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateChunkSize(fileSize int64) int
- func DerefOr[T any](v *T, def T) T
- func GetAddrInfo(ctx context.Context, api api.Gateway, maddr address.Address) (*peer.AddrInfo, error)
- func IsPublicOrDNSAddr(a multiaddr.Multiaddr) bool
- func Open(root string, opts ...OpenOption) (iface.RIBS, error)
- func OpenOrCreateWallet(path string) (*ributil.LocalWallet, address.Address, error)
- type CarSource
- type ErrRejected
- type ExternalOffloader
- type GroupDealStats
- type LimitWriter
- type LocalWebInfo
- func (lwi *LocalWebInfo) CleanExternal(gid iface.GroupKey, lpath string) error
- func (lwi *LocalWebInfo) EnsureExternalPush(gid iface.GroupKey, src CarSource) error
- func (lwi *LocalWebInfo) GetGroupExternalURL(gid iface.GroupKey, lpath string) (*string, error)
- func (lwi *LocalWebInfo) GetModuleName() string
- func (lwi *LocalWebInfo) ReadCar(ctx context.Context, group iface.GroupKey, pathStr string, off int64, ...) (io.ReadCloser, error)
- func (lwi *LocalWebInfo) ReadCarFile(ctx context.Context, group iface.GroupKey) (io.ReadSeekCloser, error)
- type OpenOption
- type ProviderAddrInfo
- type RetrCandidate
- type RetrCheckCandidate
- type RetrievalResult
- type S3OffloadInfo
- func (s *S3OffloadInfo) CleanExternal(gid iface.GroupKey, lpath string) error
- func (s *S3OffloadInfo) EnsureExternalPush(gid iface.GroupKey, src CarSource) error
- func (s *S3OffloadInfo) GetGroupExternalURL(gid iface.GroupKey, lpath string) (*string, error)
- func (s *S3OffloadInfo) GetModuleName() string
- func (s *S3OffloadInfo) ReadCar(ctx context.Context, group iface.GroupKey, path string, off int64, size int64) (io.ReadCloser, error)
- func (s *S3OffloadInfo) ReadCarFile(ctx context.Context, group iface.GroupKey) (io.ReadSeekCloser, error)
Constants ¶
View Source
const AskProtocolID = "/fil/storage/ask/1.1.0"
View Source
const AvgBlockSize = 256 << 10
View Source
const BlockCacheSize = BlockCacheSizeMiB << 20 / AvgBlockSize
View Source
const BlockCacheSizeMiB = 512
View Source
const DEBUG_LOOP_COUNT = 10000
View Source
const DealProtocolv121 = "/fil/storage/mk/1.2.1"
View Source
const DealStatusV12ProtocolID = "/fil/storage/status/1.2.0"
View Source
const EXTERNAL_LOCALWEB = "local-web"
View Source
const EXTERNAL_S3 = "s3"
View Source
const RetrievalCandidateCacheSize = 10000
View Source
const RetrievalCandidateTimeout = 5 * time.Minute
Variables ¶
View Source
var ParallelDealChecks = 10
View Source
var RepairCheckInterval = time.Minute
Functions ¶
func CalculateChunkSize ¶
func GetAddrInfo ¶
func IsPublicOrDNSAddr ¶
func OpenOrCreateWallet ¶
Types ¶
type ErrRejected ¶
type ErrRejected struct {
Reason string
}
func (ErrRejected) Error ¶
func (e ErrRejected) Error() string
type ExternalOffloader ¶
type ExternalOffloader interface {
GetModuleName() string
EnsureExternalPush(gid iface.GroupKey, src CarSource) error
GetGroupExternalURL(gid iface.GroupKey, lpath string) (*string, error)
CleanExternal(gid iface.GroupKey, lpath string) error
ReadCar(ctx context.Context, group iface.GroupKey, path string, off int64, size int64) (io.ReadCloser, error)
ReadCarFile(ctx context.Context, group iface.GroupKey) (io.ReadSeekCloser, error)
// contains filtered or unexported methods
}
type GroupDealStats ¶
type LimitWriter ¶
type LocalWebInfo ¶
type LocalWebInfo struct {
// contains filtered or unexported fields
}
func (*LocalWebInfo) CleanExternal ¶
func (lwi *LocalWebInfo) CleanExternal(gid iface.GroupKey, lpath string) error
func (*LocalWebInfo) EnsureExternalPush ¶
func (lwi *LocalWebInfo) EnsureExternalPush(gid iface.GroupKey, src CarSource) error
func (*LocalWebInfo) GetGroupExternalURL ¶
func (*LocalWebInfo) GetModuleName ¶
func (lwi *LocalWebInfo) GetModuleName() string
func (*LocalWebInfo) ReadCarFile ¶
func (lwi *LocalWebInfo) ReadCarFile(ctx context.Context, group iface.GroupKey) (io.ReadSeekCloser, error)
type OpenOption ¶
type OpenOption func(*openOptions)
func WithFileCoinApiEndpoint ¶
func WithFileCoinApiEndpoint(wp string) OpenOption
WithFileCoinApiEndpoint sets the FileCoin API endpoint used to probe the chain. Defaults to "https://api.chain.love/rpc/v1".
func WithHostGetter ¶
WithHostGetter sets the function used to instantiate the libp2p host used by RIBS. Defaults to libp2p.New.
func WithLocalWalletOpener ¶
func WithLocalWalletOpener(wg func(path string) (*ributil.LocalWallet, error)) OpenOption
WithLocalWalletOpener sets the function used to open the local wallet path. Defaults to using ributil.OpenWallet, where the wallet is instantiated if it does not exist. In a case where it is auto generated, the wallet path must be backed up elsewhere.
See: WithLocalWalletPath.
func WithLocalWalletPath ¶
func WithLocalWalletPath(wp string) OpenOption
WithLocalWalletPath sets the path to the local directory containing the wallet. Care must be taken in backing up this directory. Defaults to `.ribswallet` under user home directory.
type ProviderAddrInfo ¶
type RetrCandidate ¶
type RetrCheckCandidate ¶
type RetrievalResult ¶
type S3OffloadInfo ¶
type S3OffloadInfo struct {
Endpoint string
AccessKey string
SecretKey string
Token string
Bucket string
// contains filtered or unexported fields
}
func (*S3OffloadInfo) CleanExternal ¶
func (s *S3OffloadInfo) CleanExternal(gid iface.GroupKey, lpath string) error
func (*S3OffloadInfo) EnsureExternalPush ¶
func (s *S3OffloadInfo) EnsureExternalPush(gid iface.GroupKey, src CarSource) error
func (*S3OffloadInfo) GetGroupExternalURL ¶
func (*S3OffloadInfo) GetModuleName ¶
func (s *S3OffloadInfo) GetModuleName() string
func (*S3OffloadInfo) ReadCarFile ¶
func (s *S3OffloadInfo) ReadCarFile(ctx context.Context, group iface.GroupKey) (io.ReadSeekCloser, error)
Click to show internal directories.
Click to hide internal directories.