approver

package
v0.2.2-test.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockInterval = 2

	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
)

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")
	ErrSigner             = gfsperrors.Register(module.ApprovalModularName, http.StatusInternalServerError, 11001, "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) 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) 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 (a *ApprovalModular) QueryTasks(
	ctx context.Context,
	subKey coretask.TKey) (
	[]coretask.Task, error)

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)

func (*ApprovalModular) Start

func (a *ApprovalModular) Start(ctx context.Context) error

func (*ApprovalModular) Stop

func (a *ApprovalModular) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL