Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultMetadataOptions(metadata *MetadataModular, cfg *gfspconfig.GfSpConfig) error
- func NewMetadataModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type MetadataModular
- func (r *MetadataModular) GfSpGetBucketByBucketID(ctx context.Context, req *types.GfSpGetBucketByBucketIDRequest) (resp *types.GfSpGetBucketByBucketIDResponse, err error)
- func (r *MetadataModular) GfSpGetBucketByBucketName(ctx context.Context, req *types.GfSpGetBucketByBucketNameRequest) (resp *types.GfSpGetBucketByBucketNameResponse, err error)
- func (r *MetadataModular) GfSpGetBucketMeta(ctx context.Context, req *types.GfSpGetBucketMetaRequest) (resp *types.GfSpGetBucketMetaResponse, err error)
- func (r *MetadataModular) GfSpGetBucketReadQuota(ctx context.Context, req *types.GfSpGetBucketReadQuotaRequest) (*types.GfSpGetBucketReadQuotaResponse, error)
- func (r *MetadataModular) GfSpGetEndpointBySpAddress(ctx context.Context, req *types.GfSpGetEndpointBySpAddressRequest) (resp *types.GfSpGetEndpointBySpAddressResponse, err error)
- func (r *MetadataModular) GfSpGetGroupList(ctx context.Context, req *types.GfSpGetGroupListRequest) (resp *types.GfSpGetGroupListResponse, err error)
- func (r *MetadataModular) GfSpGetObjectMeta(ctx context.Context, req *types.GfSpGetObjectMetaRequest) (resp *types.GfSpGetObjectMetaResponse, err error)
- func (r *MetadataModular) GfSpGetPaymentByBucketID(ctx context.Context, req *types.GfSpGetPaymentByBucketIDRequest) (resp *types.GfSpGetPaymentByBucketIDResponse, err error)
- func (r *MetadataModular) GfSpGetPaymentByBucketName(ctx context.Context, req *types.GfSpGetPaymentByBucketNameRequest) (resp *types.GfSpGetPaymentByBucketNameResponse, err error)
- func (r *MetadataModular) GfSpGetUserBuckets(ctx context.Context, req *types.GfSpGetUserBucketsRequest) (resp *types.GfSpGetUserBucketsResponse, err error)
- func (r *MetadataModular) GfSpGetUserBucketsCount(ctx context.Context, req *types.GfSpGetUserBucketsCountRequest) (resp *types.GfSpGetUserBucketsCountResponse, err error)
- func (r *MetadataModular) GfSpListBucketReadRecord(ctx context.Context, req *types.GfSpListBucketReadRecordRequest) (*types.GfSpListBucketReadRecordResponse, error)
- func (r *MetadataModular) GfSpListDeletedObjectsByBlockNumberRange(ctx context.Context, ...) (resp *types.GfSpListDeletedObjectsByBlockNumberRangeResponse, err error)
- func (r *MetadataModular) GfSpListExpiredBucketsBySp(ctx context.Context, req *types.GfSpListExpiredBucketsBySpRequest) (resp *types.GfSpListExpiredBucketsBySpResponse, err error)
- func (r *MetadataModular) GfSpListObjectsByBucketName(ctx context.Context, req *types.GfSpListObjectsByBucketNameRequest) (resp *types.GfSpListObjectsByBucketNameResponse, err error)
- func (r *MetadataModular) GfSpQueryUploadProgress(ctx context.Context, req *types.GfSpQueryUploadProgressRequest) (*types.GfSpQueryUploadProgressResponse, error)
- func (r *MetadataModular) GfSpVerifyPermission(ctx context.Context, req *storagetypes.QueryVerifyPermissionRequest) (resp *storagetypes.QueryVerifyPermissionResponse, err error)
- func (r *MetadataModular) Name() string
- func (r *MetadataModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (r *MetadataModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (r *MetadataModular) Start(ctx context.Context) error
- func (r *MetadataModular) Stop(ctx context.Context) error
- func (r *MetadataModular) VerifyBucketPermission(ctx context.Context, bucketInfo *bsdb.Bucket, operator sdk.AccAddress, ...) (permtypes.Effect, error)
- func (r *MetadataModular) VerifyObjectPermission(ctx context.Context, bucketInfo *bsdb.Bucket, objectInfo *bsdb.Object, ...) (permtypes.Effect, error)
- func (r *MetadataModular) VerifyPolicy(ctx context.Context, resourceID math.Uint, resourceType resource.ResourceType, ...) (permtypes.Effect, error)
Constants ¶
const ( // DefaultQuerySPParallelPerNode defines the max parallel for retrieving request DefaultQuerySPParallelPerNode int64 = 10240 // DefaultBsDBSwitchCheckIntervalSec defines the default db switch check interval in seconds DefaultBsDBSwitchCheckIntervalSec = 30 )
const (
DefaultMetadataStatisticsInterval = 60
)
Variables ¶
var ( MetadataModularName = strings.ToLower("Metadata") MetadataModularDescription = "Retrieves sp metadata and info." )
var ( ErrDanglingPointer = gfsperrors.Register(MetadataModularName, http.StatusBadRequest, 90001, "OoooH... request lost, try again later") ErrExceedRequest = gfsperrors.Register(MetadataModularName, http.StatusNotAcceptable, 90002, "request exceed") ErrNoRecord = gfsperrors.Register(MetadataModularName, http.StatusNotFound, 90003, "no uploading record") ErrGfSpDB = gfsperrors.Register(MetadataModularName, http.StatusInternalServerError, 95202, "server slipped away, try again later") )
var ( // ErrInvalidParams defines invalid params ErrInvalidParams = errors.New("invalid params") // ErrInvalidBucketName defines invalid bucket name ErrInvalidBucketName = errors.New("invalid bucket name") // ErrNoSuchBucket defines not existed bucket error ErrNoSuchBucket = errors.New("the specified bucket does not exist") // ErrNoSuchObject defines not existed object error ErrNoSuchObject = errors.New("the specified key does not exist") )
Functions ¶
func DefaultMetadataOptions ¶
func DefaultMetadataOptions(metadata *MetadataModular, cfg *gfspconfig.GfSpConfig) error
func NewMetadataModular ¶
func NewMetadataModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
Types ¶
type MetadataModular ¶
type MetadataModular struct {
// contains filtered or unexported fields
}
func (*MetadataModular) GfSpGetBucketByBucketID ¶
func (r *MetadataModular) GfSpGetBucketByBucketID(ctx context.Context, req *types.GfSpGetBucketByBucketIDRequest) (resp *types.GfSpGetBucketByBucketIDResponse, err error)
GfSpGetBucketByBucketID get buckets info by by a bucket id
func (*MetadataModular) GfSpGetBucketByBucketName ¶
func (r *MetadataModular) GfSpGetBucketByBucketName(ctx context.Context, req *types.GfSpGetBucketByBucketNameRequest) (resp *types.GfSpGetBucketByBucketNameResponse, err error)
GfSpGetBucketByBucketName get buckets info by a bucket name
func (*MetadataModular) GfSpGetBucketMeta ¶
func (r *MetadataModular) GfSpGetBucketMeta( ctx context.Context, req *types.GfSpGetBucketMetaRequest) ( resp *types.GfSpGetBucketMetaResponse, err error)
GfSpGetBucketMeta get bucket metadata
func (*MetadataModular) GfSpGetBucketReadQuota ¶
func (r *MetadataModular) GfSpGetBucketReadQuota( ctx context.Context, req *types.GfSpGetBucketReadQuotaRequest) ( *types.GfSpGetBucketReadQuotaResponse, error)
func (*MetadataModular) GfSpGetEndpointBySpAddress ¶
func (r *MetadataModular) GfSpGetEndpointBySpAddress( ctx context.Context, req *types.GfSpGetEndpointBySpAddressRequest) ( resp *types.GfSpGetEndpointBySpAddressResponse, err error)
GfSpGetEndpointBySpAddress get endpoint by sp address
func (*MetadataModular) GfSpGetGroupList ¶
func (r *MetadataModular) GfSpGetGroupList(ctx context.Context, req *types.GfSpGetGroupListRequest) (resp *types.GfSpGetGroupListResponse, err error)
GfSpGetGroupList get group list by queryName/prefix/sourceType
func (*MetadataModular) GfSpGetObjectMeta ¶
func (r *MetadataModular) GfSpGetObjectMeta(ctx context.Context, req *types.GfSpGetObjectMetaRequest) (resp *types.GfSpGetObjectMetaResponse, err error)
GfSpGetObjectMeta get object metadata
func (*MetadataModular) GfSpGetPaymentByBucketID ¶
func (r *MetadataModular) GfSpGetPaymentByBucketID(ctx context.Context, req *types.GfSpGetPaymentByBucketIDRequest) (resp *types.GfSpGetPaymentByBucketIDResponse, err error)
GfSpGetPaymentByBucketID get bucket payment info by a bucket id
func (*MetadataModular) GfSpGetPaymentByBucketName ¶
func (r *MetadataModular) GfSpGetPaymentByBucketName(ctx context.Context, req *types.GfSpGetPaymentByBucketNameRequest) (resp *types.GfSpGetPaymentByBucketNameResponse, err error)
GfSpGetPaymentByBucketName get bucket payment info by a bucket name
func (*MetadataModular) GfSpGetUserBuckets ¶
func (r *MetadataModular) GfSpGetUserBuckets( ctx context.Context, req *types.GfSpGetUserBucketsRequest) ( resp *types.GfSpGetUserBucketsResponse, err error)
func (*MetadataModular) GfSpGetUserBucketsCount ¶
func (r *MetadataModular) GfSpGetUserBucketsCount(ctx context.Context, req *types.GfSpGetUserBucketsCountRequest) (resp *types.GfSpGetUserBucketsCountResponse, err error)
GfSpGetUserBucketsCount get buckets count by a user address
func (*MetadataModular) GfSpListBucketReadRecord ¶
func (r *MetadataModular) GfSpListBucketReadRecord( ctx context.Context, req *types.GfSpListBucketReadRecordRequest) ( *types.GfSpListBucketReadRecordResponse, error)
func (*MetadataModular) GfSpListDeletedObjectsByBlockNumberRange ¶
func (r *MetadataModular) GfSpListDeletedObjectsByBlockNumberRange(ctx context.Context, req *types.GfSpListDeletedObjectsByBlockNumberRangeRequest) (resp *types.GfSpListDeletedObjectsByBlockNumberRangeResponse, err error)
GfSpListDeletedObjectsByBlockNumberRange list deleted objects info by a block number range
func (*MetadataModular) GfSpListExpiredBucketsBySp ¶
func (r *MetadataModular) GfSpListExpiredBucketsBySp(ctx context.Context, req *types.GfSpListExpiredBucketsBySpRequest) (resp *types.GfSpListExpiredBucketsBySpResponse, err error)
GfSpListExpiredBucketsBySp list expired bucket by sp
func (*MetadataModular) GfSpListObjectsByBucketName ¶
func (r *MetadataModular) GfSpListObjectsByBucketName(ctx context.Context, req *types.GfSpListObjectsByBucketNameRequest) (resp *types.GfSpListObjectsByBucketNameResponse, err error)
GfSpListObjectsByBucketName list objects info by a bucket name
func (*MetadataModular) GfSpQueryUploadProgress ¶
func (r *MetadataModular) GfSpQueryUploadProgress(ctx context.Context, req *types.GfSpQueryUploadProgressRequest) ( *types.GfSpQueryUploadProgressResponse, error)
func (*MetadataModular) GfSpVerifyPermission ¶
func (r *MetadataModular) GfSpVerifyPermission(ctx context.Context, req *storagetypes.QueryVerifyPermissionRequest) (resp *storagetypes.QueryVerifyPermissionResponse, err error)
GfSpVerifyPermission Verify the input account’s permission to input items
func (*MetadataModular) Name ¶
func (r *MetadataModular) Name() string
func (*MetadataModular) ReleaseResource ¶
func (r *MetadataModular) ReleaseResource( ctx context.Context, span rcmgr.ResourceScopeSpan)
func (*MetadataModular) ReserveResource ¶
func (r *MetadataModular) ReserveResource( ctx context.Context, state *rcmgr.ScopeStat) ( rcmgr.ResourceScopeSpan, error)
func (*MetadataModular) VerifyBucketPermission ¶
func (r *MetadataModular) VerifyBucketPermission(ctx context.Context, bucketInfo *bsdb.Bucket, operator sdk.AccAddress, action permtypes.ActionType, options *permtypes.VerifyOptions) (permtypes.Effect, error)
VerifyBucketPermission verify bucket permission
func (*MetadataModular) VerifyObjectPermission ¶
func (r *MetadataModular) VerifyObjectPermission(ctx context.Context, bucketInfo *bsdb.Bucket, objectInfo *bsdb.Object, operator sdk.AccAddress, action permtypes.ActionType) (permtypes.Effect, error)
VerifyObjectPermission verify object permission
func (*MetadataModular) VerifyPolicy ¶
func (r *MetadataModular) VerifyPolicy(ctx context.Context, resourceID math.Uint, resourceType resource.ResourceType, operator sdk.AccAddress, action permtypes.ActionType, opts *permtypes.VerifyOptions) (permtypes.Effect, error)
VerifyPolicy verify policy of permission