Documentation ¶
Index ¶
- type Consensus
- type NullConsensus
- func (*NullConsensus) Close() error
- func (*NullConsensus) CurrentHeight(context.Context) (uint64, error)
- func (*NullConsensus) HasAccount(context.Context, string) (bool, error)
- func (*NullConsensus) ListBondedValidators(context.Context) ([]stakingtypes.Validator, error)
- func (*NullConsensus) ListSPs(context.Context) ([]*sptypes.StorageProvider, error)
- func (*NullConsensus) ListenObjectSeal(context.Context, uint64, int) (bool, error)
- func (*NullConsensus) ListenRejectUnSealObject(context.Context, uint64, int) (bool, error)
- func (*NullConsensus) QueryBucketInfo(context.Context, string) (*storagetypes.BucketInfo, error)
- func (*NullConsensus) QueryBucketInfoAndObjectInfo(context.Context, string, string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
- func (*NullConsensus) QueryObjectInfo(context.Context, string, string) (*storagetypes.ObjectInfo, error)
- func (*NullConsensus) QueryObjectInfoByID(context.Context, string) (*storagetypes.ObjectInfo, error)
- func (*NullConsensus) QueryPaymentStreamRecord(context.Context, string) (*paymenttypes.StreamRecord, error)
- func (*NullConsensus) QueryStorageParams(context.Context) (*storagetypes.Params, error)
- func (*NullConsensus) QueryStorageParamsByTimestamp(context.Context, int64) (*storagetypes.Params, error)
- func (*NullConsensus) VerifyGetObjectPermission(context.Context, string, string, string) (bool, error)
- func (*NullConsensus) VerifyPutObjectPermission(context.Context, string, string, string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consensus ¶
type Consensus interface { // CurrentHeight returns the current greenfield height - 1, CurrentHeight(ctx context.Context) (uint64, error) // HasAccount returns an indicator whether the account has been created. HasAccount(ctx context.Context, account string) (bool, error) // ListSPs returns all SP info. ListSPs(ctx context.Context) ([]*sptypes.StorageProvider, error) // ListBondedValidators returns all bonded validators info. ListBondedValidators(ctx context.Context) ([]stakingtypes.Validator, error) // QueryStorageParams returns the storage params. QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error) // QueryStorageParamsByTimestamp returns the storage params by block create time. QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (params *storagetypes.Params, err error) // QueryBucketInfo returns the bucket info by bucket name. QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error) // QueryObjectInfo returns the object info by bucket and object name. QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error) // QueryObjectInfoByID returns the object info by object ID. QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error) // QueryBucketInfoAndObjectInfo returns the bucket and object info by bucket and object name. QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error) // QueryPaymentStreamRecord returns the account payment status. QueryPaymentStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error) // VerifyGetObjectPermission returns an indicator whether the account has permission to get object. VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error) // VerifyPutObjectPermission returns an indicator whether the account has permission to put object. VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error) // ListenObjectSeal returns an indicator whether the object is successfully sealed before timeOutHeight. ListenObjectSeal(ctx context.Context, objectID uint64, timeOutHeight int) (bool, error) // ListenRejectUnSealObject returns an indication of the object is rejected. ListenRejectUnSealObject(ctx context.Context, objectID uint64, timeoutHeight int) (bool, error) // Close the Consensus interface. Close() error }
Consensus is the interface to query greenfield consensus data. the consensus data can come from validator, full-node, or other off-chain data service
type NullConsensus ¶
type NullConsensus struct{}
func (*NullConsensus) Close ¶
func (*NullConsensus) Close() error
func (*NullConsensus) CurrentHeight ¶
func (*NullConsensus) CurrentHeight(context.Context) (uint64, error)
func (*NullConsensus) HasAccount ¶
func (*NullConsensus) ListBondedValidators ¶
func (*NullConsensus) ListBondedValidators(context.Context) ([]stakingtypes.Validator, error)
func (*NullConsensus) ListSPs ¶
func (*NullConsensus) ListSPs(context.Context) ([]*sptypes.StorageProvider, error)
func (*NullConsensus) ListenObjectSeal ¶
func (*NullConsensus) ListenRejectUnSealObject ¶
func (*NullConsensus) QueryBucketInfo ¶
func (*NullConsensus) QueryBucketInfo(context.Context, string) (*storagetypes.BucketInfo, error)
func (*NullConsensus) QueryBucketInfoAndObjectInfo ¶
func (*NullConsensus) QueryBucketInfoAndObjectInfo(context.Context, string, string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
func (*NullConsensus) QueryObjectInfo ¶
func (*NullConsensus) QueryObjectInfo(context.Context, string, string) (*storagetypes.ObjectInfo, error)
func (*NullConsensus) QueryObjectInfoByID ¶
func (*NullConsensus) QueryObjectInfoByID(context.Context, string) (*storagetypes.ObjectInfo, error)
func (*NullConsensus) QueryPaymentStreamRecord ¶
func (*NullConsensus) QueryPaymentStreamRecord(context.Context, string) (*paymenttypes.StreamRecord, error)
func (*NullConsensus) QueryStorageParams ¶
func (*NullConsensus) QueryStorageParams(context.Context) (*storagetypes.Params, error)
func (*NullConsensus) QueryStorageParamsByTimestamp ¶
func (*NullConsensus) QueryStorageParamsByTimestamp(context.Context, int64) (*storagetypes.Params, error)
func (*NullConsensus) VerifyGetObjectPermission ¶
func (*NullConsensus) VerifyPutObjectPermission ¶
Click to show internal directories.
Click to hide internal directories.