Documentation ¶
Index ¶
- Constants
- Variables
- func ErrSignerWithDetail(detail string) *gfsperrors.GfSpError
- func NewApprovalModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type ApprovalModular
- func (a *ApprovalModular) GCApprovalQueue(qTask task.Task) bool
- func (a *ApprovalModular) GetCurrentBlockHeight() uint64
- func (a *ApprovalModular) HandleCreateBucketApprovalTask(ctx context.Context, task coretask.ApprovalCreateBucketTask) (bool, error)
- func (a *ApprovalModular) HandleCreateObjectApprovalTask(ctx context.Context, task coretask.ApprovalCreateObjectTask) (bool, error)
- func (a *ApprovalModular) HandleDelegateCreateObjectApprovalTask(ctx context.Context, task coretask.ApprovalDelegateCreateObjectTask) (bool, error)
- func (a *ApprovalModular) HandleMigrateBucketApprovalTask(ctx context.Context, task coretask.ApprovalMigrateBucketTask) (bool, error)
- func (a *ApprovalModular) Name() string
- func (a *ApprovalModular) PostCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask)
- func (a *ApprovalModular) PostCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask)
- func (a *ApprovalModular) PostMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask)
- func (a *ApprovalModular) PreCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) error
- func (a *ApprovalModular) PreCreateObjectApproval(_ context.Context, _ coretask.ApprovalCreateObjectTask) error
- func (a *ApprovalModular) PreMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask) error
- func (a *ApprovalModular) QueryTasks(ctx context.Context, subKey coretask.TKey) ([]coretask.Task, error)
- func (a *ApprovalModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (a *ApprovalModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (a *ApprovalModular) SetCurrentBlockHeight(height uint64)
- func (a *ApprovalModular) Start(ctx context.Context) error
- func (a *ApprovalModular) Stop(ctx context.Context) error
Constants ¶
View Source
const ( DefaultBlockInterval = 3 DefaultApprovalExpiredTimeout = int64(DefaultBlockInterval * 20) )
View Source
const ( // DefaultAccountBucketNumber defines the default value of bucket number is // owned by the same account DefaultAccountBucketNumber = 100 // DefaultBucketApprovalTimeoutHeight defines the default value of timeout // height for creating bucket approval DefaultBucketApprovalTimeoutHeight uint64 = 100 // DefaultObjectApprovalTimeoutHeight defines the default value of timeout // // height for creating object approval DefaultObjectApprovalTimeoutHeight uint64 = 100 // DefaultCreateBucketApprovalParallel defines the default value of parallel // for approved create bucket per approver DefaultCreateBucketApprovalParallel = 10240 // DefaultCreateObjectApprovalParallel defines the default value of parallel // for approved create object per approver DefaultCreateObjectApprovalParallel = 10240 )
View Source
const (
SigExpireTimeSecond = 60 * 60
)
Variables ¶
View Source
var ( ErrDanglingPointer = gfsperrors.Register(module.ApprovalModularName, http.StatusBadRequest, 10001, "OoooH.... request lost") ErrExceedBucketNumber = gfsperrors.Register(module.ApprovalModularName, http.StatusNotAcceptable, 10002, "account buckets exceed the limit") ErrExceedApprovalLimit = gfsperrors.Register(module.ApprovalModularName, http.StatusNotAcceptable, 10003, "SP is too busy to approve the request, please come back later") )
Functions ¶
func ErrSignerWithDetail ¶ added in v0.2.4
func ErrSignerWithDetail(detail string) *gfsperrors.GfSpError
func NewApprovalModular ¶
func NewApprovalModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
Types ¶
type ApprovalModular ¶
type ApprovalModular struct {
// contains filtered or unexported fields
}
func (*ApprovalModular) GCApprovalQueue ¶
func (a *ApprovalModular) GCApprovalQueue(qTask task.Task) bool
GCApprovalQueue defines the strategy of gc approval queue when the queue is full. if the approval is expired, it can be deleted.
func (*ApprovalModular) GetCurrentBlockHeight ¶
func (a *ApprovalModular) GetCurrentBlockHeight() uint64
func (*ApprovalModular) HandleCreateBucketApprovalTask ¶
func (a *ApprovalModular) HandleCreateBucketApprovalTask(ctx context.Context, task coretask.ApprovalCreateBucketTask) (bool, error)
func (*ApprovalModular) HandleCreateObjectApprovalTask ¶
func (a *ApprovalModular) HandleCreateObjectApprovalTask(ctx context.Context, task coretask.ApprovalCreateObjectTask) (bool, error)
func (*ApprovalModular) HandleDelegateCreateObjectApprovalTask ¶ added in v1.6.0
func (a *ApprovalModular) HandleDelegateCreateObjectApprovalTask(ctx context.Context, task coretask.ApprovalDelegateCreateObjectTask) (bool, error)
func (*ApprovalModular) HandleMigrateBucketApprovalTask ¶ added in v0.2.3
func (a *ApprovalModular) HandleMigrateBucketApprovalTask(ctx context.Context, task coretask.ApprovalMigrateBucketTask) (bool, error)
func (*ApprovalModular) Name ¶
func (a *ApprovalModular) Name() string
func (*ApprovalModular) PostCreateBucketApproval ¶
func (a *ApprovalModular) PostCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask)
func (*ApprovalModular) PostCreateObjectApproval ¶
func (a *ApprovalModular) PostCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask)
func (*ApprovalModular) PostMigrateBucketApproval ¶ added in v0.2.3
func (a *ApprovalModular) PostMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask)
func (*ApprovalModular) PreCreateBucketApproval ¶
func (a *ApprovalModular) PreCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) error
func (*ApprovalModular) PreCreateObjectApproval ¶
func (a *ApprovalModular) PreCreateObjectApproval(_ context.Context, _ coretask.ApprovalCreateObjectTask) error
func (*ApprovalModular) PreMigrateBucketApproval ¶ added in v0.2.3
func (a *ApprovalModular) PreMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask) error
func (*ApprovalModular) QueryTasks ¶
func (*ApprovalModular) ReleaseResource ¶
func (a *ApprovalModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
func (*ApprovalModular) ReserveResource ¶
func (a *ApprovalModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
func (*ApprovalModular) SetCurrentBlockHeight ¶
func (a *ApprovalModular) SetCurrentBlockHeight(height uint64)
Click to show internal directories.
Click to hide internal directories.