approver

package
v0.2.1-alpha.5 Latest Latest
Warning

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

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

Documentation

Index

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 = 1024
	// DefaultCreateObjectApprovalParallel defines the default value of parallel
	// for approved create object per approver
	DefaultCreateObjectApprovalParallel = 1024
)

Variables

View Source
var (
	ErrDanglingPointer    = gfsperrors.Register(module.ApprovalModularName, http.StatusInternalServerError, 10001, "OoooH.... request lost")
	ErrExceedBucketNumber = gfsperrors.Register(module.ApprovalModularName, http.StatusServiceUnavailable, 10002, "account buckets exceed the limit")
	ErrRepeatedTask       = gfsperrors.Register(module.ApprovalModularName, http.StatusBadRequest, 10003, "ask approval request repeated")
	ErrExceedQueue        = gfsperrors.Register(module.ApprovalModularName, http.StatusServiceUnavailable, 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 (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) 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