Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultApprovalOptions(cfg *gfspconfig.GfSpConfig, approver *ApprovalModular) error
- func NewApprovalModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type ApprovalModular
- func (a *ApprovalModular) GCApprovalQueue(qTask task.Task) bool
- 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) 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) PreCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) error
- func (a *ApprovalModular) PreCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask) 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) Start(ctx context.Context) error
- func (a *ApprovalModular) Stop(ctx context.Context) error
Constants ¶
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 = 10 // DefaultObjectApprovalTimeoutHeight defines the default value of timeout // // height for creating object approval DefaultObjectApprovalTimeoutHeight uint64 = 10 // 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 )
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") ErrRepeatedTask = gfsperrors.Register(module.ApprovalModularName, http.StatusBadRequest, 10003, "ask approval request repeated") ErrExceedQueue = gfsperrors.Register(module.ApprovalModularName, http.StatusNotAcceptable, 10004, "ask approval request exceed the limit, try again later") ErrSigner = gfsperrors.Register(module.ApprovalModularName, http.StatusInternalServerError, 11001, "server slipped away, try again later") ErrConsensus = gfsperrors.Register(module.ApprovalModularName, http.StatusInternalServerError, 15001, "server slipped away, try again later") )
Functions ¶
func DefaultApprovalOptions ¶
func DefaultApprovalOptions(cfg *gfspconfig.GfSpConfig, approver *ApprovalModular) error
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) 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) 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) PreCreateBucketApproval ¶
func (a *ApprovalModular) PreCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) error
func (*ApprovalModular) PreCreateObjectApproval ¶
func (a *ApprovalModular) PreCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask) 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)
Click to show internal directories.
Click to hide internal directories.