Documentation ¶
Overview ¶
Code generated by MockGen. DO NOT EDIT. Source: ./upload_server.go
Generated by this command:
mockgen -source=./upload_server.go -destination=./upload_server_mock.go -package=gfspapp
Package gfspapp is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ClearRegisterModules()
- func DefaultGfBsDBOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpClientOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpConsensusOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpDBOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpMetricOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpModuleOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpPProfOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpPieceOpOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpPieceStoreOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpProbeOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpResourceManagerOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGfSpTQueueOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func DefaultGrpcServerOptions() []grpc.ServerOption
- func DefaultStaticOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
- func GetRegisterModuleDescription() string
- func GetRegisteredModules() []string
- func RegisterModular(name string, description string, newFunc NewModularFunc)
- type GfSpBaseApp
- func (g *GfSpBaseApp) AppID() string
- func (g *GfSpBaseApp) ChainID() string
- func (g *GfSpBaseApp) Consensus() consensus.Consensus
- func (g *GfSpBaseApp) Done() <-chan struct{}
- func (g *GfSpBaseApp) EnableMetrics() bool
- func (g *GfSpBaseApp) GetAuthNonce(ctx context.Context, req *gfspserver.GetAuthNonceRequest) (*gfspserver.GetAuthNonceResponse, error)
- func (g *GfSpBaseApp) GetProbe() coreprober.Prober
- func (g *GfSpBaseApp) GfBsDB() bsdb.BSDB
- func (g *GfSpBaseApp) GfBsDBMaster() bsdb.BSDB
- func (g *GfSpBaseApp) GfSpAskApproval(ctx context.Context, req *gfspserver.GfSpAskApprovalRequest) (*gfspserver.GfSpAskApprovalResponse, error)
- func (g *GfSpBaseApp) GfSpAskSecondaryReplicatePieceApproval(ctx context.Context, ...) (*gfspserver.GfSpAskSecondaryReplicatePieceApprovalResponse, error)
- func (g *GfSpBaseApp) GfSpAskTask(ctx context.Context, req *gfspserver.GfSpAskTaskRequest) (*gfspserver.GfSpAskTaskResponse, error)
- func (g *GfSpBaseApp) GfSpBeginTask(ctx context.Context, req *gfspserver.GfSpBeginTaskRequest) (*gfspserver.GfSpBeginTaskResponse, error)
- func (g *GfSpBaseApp) GfSpClient() gfspclient.GfSpClientAPI
- func (g *GfSpBaseApp) GfSpDB() spdb.SPDB
- func (g *GfSpBaseApp) GfSpDeductQuotaForBucketMigrate(ctx context.Context, ...) (*gfspserver.GfSpDeductQuotaForBucketMigrateResponse, error)
- func (g *GfSpBaseApp) GfSpDoneReplicatePiece(ctx context.Context, req *gfspserver.GfSpDoneReplicatePieceRequest) (resp *gfspserver.GfSpDoneReplicatePieceResponse, err error)
- func (g *GfSpBaseApp) GfSpDownloadObject(ctx context.Context, req *gfspserver.GfSpDownloadObjectRequest) (*gfspserver.GfSpDownloadObjectResponse, error)
- func (g *GfSpBaseApp) GfSpDownloadPiece(ctx context.Context, req *gfspserver.GfSpDownloadPieceRequest) (*gfspserver.GfSpDownloadPieceResponse, error)
- func (g *GfSpBaseApp) GfSpGetChallengeInfo(ctx context.Context, req *gfspserver.GfSpGetChallengeInfoRequest) (*gfspserver.GfSpGetChallengeInfoResponse, error)
- func (g *GfSpBaseApp) GfSpNotifyMigrateSwapOut(ctx context.Context, req *gfspserver.GfSpNotifyMigrateSwapOutRequest) (*gfspserver.GfSpNotifyMigrateSwapOutResponse, error)
- func (g *GfSpBaseApp) GfSpNotifyPostMigrate(ctx context.Context, req *gfspserver.GfSpNotifyPostMigrateBucketRequest) (*gfspserver.GfSpNotifyPostMigrateBucketResponse, error)
- func (g *GfSpBaseApp) GfSpNotifyPreMigrate(ctx context.Context, req *gfspserver.GfSpNotifyPreMigrateBucketRequest) (*gfspserver.GfSpNotifyPreMigrateBucketResponse, error)
- func (g *GfSpBaseApp) GfSpPickVirtualGroupFamily(ctx context.Context, req *gfspserver.GfSpPickVirtualGroupFamilyRequest) (*gfspserver.GfSpPickVirtualGroupFamilyResponse, error)
- func (g *GfSpBaseApp) GfSpQueryBucketMigrate(ctx context.Context, req *gfspserver.GfSpQueryBucketMigrateRequest) (*gfspserver.GfSpQueryBucketMigrateResponse, error)
- func (g *GfSpBaseApp) GfSpQueryP2PBootstrap(ctx context.Context, req *gfspserver.GfSpQueryP2PNodeRequest) (*gfspserver.GfSpQueryP2PNodeResponse, error)
- func (g *GfSpBaseApp) GfSpQueryResourceLimit(context.Context, *gfspserver.GfSpQueryResourceLimitRequest) (*gfspserver.GfSpQueryResourceLimitResponse, error)
- func (g *GfSpBaseApp) GfSpQuerySpExit(ctx context.Context, req *gfspserver.GfSpQuerySpExitRequest) (*gfspserver.GfSpQuerySpExitResponse, error)
- func (g *GfSpBaseApp) GfSpQueryTasks(ctx context.Context, req *gfspserver.GfSpQueryTasksRequest) (*gfspserver.GfSpQueryTasksResponse, error)
- func (g *GfSpBaseApp) GfSpQueryTasksStats(ctx context.Context, _ *gfspserver.GfSpQueryTasksStatsRequest) (*gfspserver.GfSpQueryTasksStatsResponse, error)
- func (g *GfSpBaseApp) GfSpReimburseQuota(ctx context.Context, fixRequest *gfspserver.GfSpReimburseQuotaRequest) (*gfspserver.GfSpReimburseQuotaResponse, error)
- func (g *GfSpBaseApp) GfSpReplicatePiece(ctx context.Context, req *gfspserver.GfSpReplicatePieceRequest) (resp *gfspserver.GfSpReplicatePieceResponse, err error)
- func (g *GfSpBaseApp) GfSpReportTask(ctx context.Context, req *gfspserver.GfSpReportTaskRequest) (*gfspserver.GfSpReportTaskResponse, error)
- func (g *GfSpBaseApp) GfSpResetRecoveryFailedList(ctx context.Context, _ *gfspserver.GfSpResetRecoveryFailedListRequest) (*gfspserver.GfSpResetRecoveryFailedListResponse, error)
- func (g *GfSpBaseApp) GfSpResumableUploadObject(stream gfspserver.GfSpUploadService_GfSpResumableUploadObjectServer) error
- func (g *GfSpBaseApp) GfSpSetResourceLimit(context.Context, *gfspserver.GfSpSetResourceLimitRequest) (*gfspserver.GfSpSetResourceLimitResponse, error)
- func (g *GfSpBaseApp) GfSpSign(ctx context.Context, req *gfspserver.GfSpSignRequest) (*gfspserver.GfSpSignResponse, error)
- func (g *GfSpBaseApp) GfSpUploadObject(stream gfspserver.GfSpUploadService_GfSpUploadObjectServer) error
- func (g *GfSpBaseApp) GfSpVerifyAuthentication(ctx context.Context, req *gfspserver.GfSpAuthenticationRequest) (*gfspserver.GfSpAuthenticationResponse, error)
- func (g *GfSpBaseApp) OnAskCreateBucketApproval(ctx context.Context, task task.ApprovalCreateBucketTask) (allow bool, err error)
- func (g *GfSpBaseApp) OnAskCreateObjectApproval(ctx context.Context, task task.ApprovalCreateObjectTask) (allow bool, err error)
- func (g *GfSpBaseApp) OnAskMigrateBucketApproval(ctx context.Context, task task.ApprovalMigrateBucketTask) (bool, error)
- func (g *GfSpBaseApp) OnAskTask(ctx context.Context, limit corercmgr.Limit) (coretask.Task, error)
- func (g *GfSpBaseApp) OnBeginResumableUploadObjectTask(ctx context.Context, task coretask.ResumableUploadObjectTask) error
- func (g *GfSpBaseApp) OnBeginUploadObjectTask(ctx context.Context, task coretask.UploadObjectTask) (err error)
- func (g *GfSpBaseApp) OnChallengePieceTask(ctx context.Context, challengePieceTask task.ChallengePieceTask) (integrity []byte, checksums [][]byte, data []byte, err error)
- func (g *GfSpBaseApp) OnDownloadObjectTask(ctx context.Context, downloadObjectTask task.DownloadObjectTask) ([]byte, error)
- func (g *GfSpBaseApp) OnDownloadPieceTask(ctx context.Context, downloadPieceTask task.DownloadPieceTask) (data []byte, err error)
- func (g *GfSpBaseApp) OperatorAddress() string
- func (g *GfSpBaseApp) PieceOp() piecestore.PieceOp
- func (g *GfSpBaseApp) PieceStore() piecestore.PieceStore
- func (g *GfSpBaseApp) RegisterServices(services ...corelifecycle.Service)
- func (g *GfSpBaseApp) ResourceManager() corercmgr.ResourceManager
- func (g *GfSpBaseApp) ServerForRegister() *grpc.Server
- func (g *GfSpBaseApp) SetAppID(appID string)
- func (g *GfSpBaseApp) SetChainID(chainID string)
- func (g *GfSpBaseApp) SetConsensus(chain consensus.Consensus)
- func (g *GfSpBaseApp) SetGfBsDB(setDB bsdb.BSDB)
- func (g *GfSpBaseApp) SetGfSpClient(clientAPI gfspclient.GfSpClientAPI)
- func (g *GfSpBaseApp) SetGfSpDB(db spdb.SPDB)
- func (g *GfSpBaseApp) SetOperatorAddress(operatorAddress string)
- func (g *GfSpBaseApp) SetPieceOp(pieceOp piecestore.PieceOp)
- func (g *GfSpBaseApp) SetPieceStore(ps piecestore.PieceStore)
- func (g *GfSpBaseApp) SetProbe(prober coreprober.Prober)
- func (g *GfSpBaseApp) SetResourceManager(rcmgr corercmgr.ResourceManager)
- func (g *GfSpBaseApp) Signals(sigs ...os.Signal) corelifecycle.Lifecycle
- func (g *GfSpBaseApp) Start(ctx context.Context) error
- func (g *GfSpBaseApp) StartRPCServer(ctx context.Context) error
- func (g *GfSpBaseApp) StartServices(ctx context.Context) corelifecycle.Lifecycle
- func (g *GfSpBaseApp) StopRPCServer(ctx context.Context) error
- func (g *GfSpBaseApp) StopServices(ctx context.Context)
- func (g *GfSpBaseApp) TaskMaxRetry(task coretask.Task) int64
- func (g *GfSpBaseApp) TaskPriority(task coretask.Task) coretask.TPriority
- func (g *GfSpBaseApp) TaskPriorityLevel(task coretask.Task) coretask.TPriorityLevel
- func (g *GfSpBaseApp) TaskTimeout(task coretask.Task, size uint64) int64
- func (g *GfSpBaseApp) UpdateUserPublicKey(ctx context.Context, req *gfspserver.UpdateUserPublicKeyRequest) (*gfspserver.UpdateUserPublicKeyResponse, error)
- func (g *GfSpBaseApp) VerifyGNFD1EddsaSignature(ctx context.Context, req *gfspserver.VerifyGNFD1EddsaSignatureRequest) (*gfspserver.VerifyGNFD1EddsaSignatureResponse, error)
- func (g *GfSpBaseApp) Wait(ctx context.Context)
- type MockgRPCResumableUploadStream
- func (m *MockgRPCResumableUploadStream) Context() context.Context
- func (m *MockgRPCResumableUploadStream) EXPECT() *MockgRPCResumableUploadStreamMockRecorder
- func (m *MockgRPCResumableUploadStream) Recv() (*gfspserver.GfSpResumableUploadObjectRequest, error)
- func (m_2 *MockgRPCResumableUploadStream) RecvMsg(m any) error
- func (m *MockgRPCResumableUploadStream) SendAndClose(arg0 *gfspserver.GfSpResumableUploadObjectResponse) error
- func (m *MockgRPCResumableUploadStream) SendHeader(arg0 metadata.MD) error
- func (m_2 *MockgRPCResumableUploadStream) SendMsg(m any) error
- func (m *MockgRPCResumableUploadStream) SetHeader(arg0 metadata.MD) error
- func (m *MockgRPCResumableUploadStream) SetTrailer(arg0 metadata.MD)
- type MockgRPCResumableUploadStreamMockRecorder
- func (mr *MockgRPCResumableUploadStreamMockRecorder) Context() *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) Recv() *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) RecvMsg(m any) *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) SendAndClose(arg0 any) *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) SendHeader(arg0 any) *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) SendMsg(m any) *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) SetHeader(arg0 any) *gomock.Call
- func (mr *MockgRPCResumableUploadStreamMockRecorder) SetTrailer(arg0 any) *gomock.Call
- type MockgRPCUploadStream
- func (m *MockgRPCUploadStream) Context() context.Context
- func (m *MockgRPCUploadStream) EXPECT() *MockgRPCUploadStreamMockRecorder
- func (m *MockgRPCUploadStream) Recv() (*gfspserver.GfSpUploadObjectRequest, error)
- func (m_2 *MockgRPCUploadStream) RecvMsg(m any) error
- func (m *MockgRPCUploadStream) SendAndClose(arg0 *gfspserver.GfSpUploadObjectResponse) error
- func (m *MockgRPCUploadStream) SendHeader(arg0 metadata.MD) error
- func (m_2 *MockgRPCUploadStream) SendMsg(m any) error
- func (m *MockgRPCUploadStream) SetHeader(arg0 metadata.MD) error
- func (m *MockgRPCUploadStream) SetTrailer(arg0 metadata.MD)
- type MockgRPCUploadStreamMockRecorder
- func (mr *MockgRPCUploadStreamMockRecorder) Context() *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) Recv() *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) RecvMsg(m any) *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) SendAndClose(arg0 any) *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) SendHeader(arg0 any) *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) SendMsg(m any) *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) SetHeader(arg0 any) *gomock.Call
- func (mr *MockgRPCUploadStreamMockRecorder) SetTrailer(arg0 any) *gomock.Call
- type ModularManager
- type NewModularFunc
- type Option
Constants ¶
const ( // EnvLocal defines the default environment. EnvLocal = "local" // EnvDevnet defines the devnet environment. EnvDevnet = "devnet" // EvnQAnet defines the qanet environment. EvnQAnet = "qanet" // EvnTestnet defines the testnet environment. EvnTestnet = "testnet" // EnvMainnet defines the mainnet environment. And as default environment. EnvMainnet = "mainnet" // DefaultGfSpAppIDPrefix defines the default app id prefix. DefaultGfSpAppIDPrefix = "gfsp" // DefaultGRPCAddress defines the default gRPC address. DefaultGRPCAddress = "localhost:9333" // DefaultMetricsAddress defines the default metrics service address. DefaultMetricsAddress = "localhost:24367" // DefaultPProfAddress defines the default pprof service address. DefaultPProfAddress = "localhost:24368" // DefaultProbeAddress defines the default probe service address. DefaultProbeAddress = "localhost:24369" // DefaultChainID defines the default greenfield chainID. DefaultChainID = "greenfield_9000-121" // DefaultChainAddress defines the default greenfield address. DefaultChainAddress = "http://localhost:26750" // DefaultMemoryLimit defines the default memory limit for resource manager. DefaultMemoryLimit = 8 * 1024 * 1024 * 1024 // DefaultTaskTotalLimit defines the default total task limit for resource manager. DefaultTaskTotalLimit = 10240 // DefaultHighTaskLimit defines the default high priority task limit for resource manager. DefaultHighTaskLimit = 128 // DefaultMediumTaskLimit defines the default medium priority task limit for resource manager. DefaultMediumTaskLimit = 1024 // DefaultLowTaskLimit defines the default low priority task limit for resource manager. DefaultLowTaskLimit = 16 )
const ( ApproverSuccessGetBucketApproval = "approver_get_bucket_success" ApproverFailureGetBucketApproval = "approver_get_bucket_failure" ApproverSuccessGetObjectApproval = "approver_get_object_success" ApproverFailureGetObjectApproval = "approver_get_object_failure" AuthSuccess = "auth_success" AuthFailure = "auth_failure" DownloaderSuccessGetPiece = "downloader_get_piece_success" DownloaderFailureGetPiece = "downloader_get_piece_failure" DownloaderSuccessGetChallengeInfo = "downloader_get_challenge_info_success" DownloaderFailureGetChallengeInfo = "downloader_get_challenge_info_failure" ManagerBeginUpload = "manager_begin_upload_success" ManagerFailureBeginUpload = "manager_begin_upload_failure" ManagerSuccessDispatchTask = "manager_dispatch_task_success" ManagerDispatchReplicateTask = "manager_dispatch_replicate_task_success" ManagerDispatchSealTask = "manager_dispatch_seal_task_success" ManagerDispatchReceiveTask = "manager_dispatch_receive_task_success" ManagerDispatchGCObjectTask = "manager_dispatch_gc_object_task_success" ManagerDispatchRecoveryTask = "manager_dispatch_recovery_task_success" ManagerNoDispatchTask = "manager_no_dispatch_task_failure" ManagerFailureDispatchTask = "manager_dispatch_task_failure" ManagerReportTask = "manager_report_task_success" ManagerReportUploadTask = "manager_report_upload_task_success" ManagerReportReplicateTask = "manager_report_replicate_task_success" ManagerReportSealTask = "manager_report_seal_task_success" ManagerReportReceiveTask = "manager_report_receive_task_success" ManagerReportGCObjectTask = "manager_report_gc_object_task_success" ManagerReportRecoveryTask = "manager_report_recovery_task_success" ReceiverSuccessReplicatePiece = "receiver_replicate_piece_success" ReceiverFailureReplicatePiece = "receiver_replicate_piece_failure" ReceiverSuccessDoneReplicatePiece = "receiver_done_replicate_piece_success" ReceiverFailureDoneReplicatePiece = "receiver_done_replicate_piece_failure" SignerSuccess = "signer_success" SignerFailure = "signer_failure" SignerSuccessBucketApproval = "signer_bucket_approval_success" SignerFailureBucketApproval = "signer_bucket_approval_failure" SignerSuccessMigrateBucketApproval = "signer_migrate_bucket_approval_success" SignerFailureMigrateBucketApproval = "signer_migrate_bucket_approval_failure" SignerSuccessObjectApproval = "signer_object_approval_success" SignerFailureObjectApproval = "signer_object_approval_failure" SignerSuccessSealObject = "signer_seal_object_success" SignerFailureSealObject = "signer_seal_object_failure" SignerSuccessRejectUnSealObject = "signer_reject_unseal_object_success" SignerFailureRejectUnSealObject = "signer_reject_unseal_object_failure" SignerSuccessDiscontinueBucket = "signer_discontinue_bucket_success" SignerFailureDiscontinueBucket = "signer_discontinue_bucket_failure" SignerSuccessIntegrityHash = "signer_integrity_hash_success" SignerFailureIntegrityHash = "signer_integrity_hash_failure" SignerSuccessPing = "signer_ping_success" SignerFailurePing = "signer_ping_failure" SignerSuccessPong = "signer_pong_success" SignerFailurePong = "signer_pong_failure" SignerSuccessReceiveTask = "signer_receive_task_success" SignerFailureReceiveTask = "signer_receive_task_failure" SignerSuccessReplicateApproval = "signer_secondary_approval_success" SignerFailureReplicateApproval = "signer_secondary_approval_failure" SignerSuccessCreateGVG = "signer_create_gvg_success" SignerFailureCreateGVG = "signer_create_gvg_failure" SignerSuccessRecoveryTask = "signer_recovery_task_success" SignerFailureRecoveryTask = "signer_recovery_task_failure" SignerSuccessCompleteMigrateBucket = "signer_complete_migration_bucket_success" SignerFailureCompleteMigrateBucket = "signer_complete_migration_bucket_failure" SignerSuccessSecondarySPMigrationBucket = "signer_secondary_sp_migration_bucket_success" SignerFailureSecondarySPMigrationBucket = "signer_secondary_sp_migration_bucket_failure" SignerSuccessSwapOut = "signer_swap_out_success" SignerFailureSwapOut = "signer_swap_out_failure" SignerSuccessSignSwapOut = "signer_sign_swap_out_success" SignerFailureSignSwapOut = "signer_sign_swap_out_failure" SignerSuccessCompleteSwapOut = "signer_complete_swap_out_success" SignerFailureCompleteSwapOut = "signer_complete_swap_out_failure" SignerSuccessSPExit = "signer_sp_exit_success" SignerFailureSPExit = "signer_sp_exit_failure" SignerSuccessCompleteSPExit = "signer_complete_sp_exit_success" SignerFailureCompleteSPExit = "signer_complete_sp_exit_failure" SignerSuccessSPStoragePrice = "signer_sp_storage_price_success" SignerFailureSPStoragePrice = "signer_sp_storage_price_failure" SignerSuccessMigrateGVGTask = "signer_migrate_gvg_task_success" SignerFailureMigrateGVGTask = "signer_migrate_gvg_task_failure" SignerSuccessGfSpBucketMigrateInfo = "signer_gfsp_bucket_migrate_info_success" SignerFailureGfSpBucketMigrateInfo = "signer_gfsp_bucket_migrate_info_failure" SignerSuccessRejectMigrateBucket = "signer_reject_migrate_bucket_success" SignerFailureRejectMigrateBucket = "signer_reject_migrate_bucket_failure" SignerSuccessDeposit = "signer_deposit_success" SignerFailureDeposit = "signer_deposit_failure" SignerSuccessDeleteGlobalVirtualGroup = "signer_delete_global_virtual_group_success" SignerFailureDeleteGlobalVirtualGroup = "signer_delete_global_virtual_group_failure" UploaderSuccessPutObject = "uploader_put_object_success" UploaderFailurePutObject = "uploader_put_object_failure" )
const ( // MiB defines the MB size MiB = 1024 * 1024 // MinSpeed defines the min speed for data transfer MinSpeed = 10 * MiB // NotUseTimeout defines the default task timeout. NotUseTimeout int64 = 0 // MinUploadTime defines the min timeout to upload object. MinUploadTime int64 = 2 // MaxUploadTime defines the max timeout to upload object. MaxUploadTime int64 = 300 // MinReplicateTime defines the min timeout to replicate object. MinReplicateTime int64 = 90 // MaxReplicateTime defines the max timeout to replicate object. MaxReplicateTime int64 = 500 // MinReceiveTime defines the min timeout to confirm the received piece whether is sealed on greenfield. MinReceiveTime int64 = 90 // MaxReceiveTime defines the max timeout to confirm the received piece whether is sealed on greenfield. MaxReceiveTime int64 = 300 // MinSealObjectTime defines the min timeout to seal object to greenfield. MinSealObjectTime int64 = 90 // MaxSealObjectTime defines the max timeout to seal object to greenfield. MaxSealObjectTime int64 = 300 // MinDownloadTime defines the min timeout to download object. MinDownloadTime int64 = 2 // MaxDownloadTime defines the max timeout to download object. MaxDownloadTime int64 = 300 // MinGCObjectTime defines the min timeout to gc object. MinGCObjectTime int64 = 300 // MaxGCObjectTime defines the max timeout to gc object. MaxGCObjectTime int64 = 600 // MinGCZombieTime defines the min timeout to gc zombie piece. MinGCZombieTime int64 = 300 // MaxGCZombieTime defines the max timeout to gc zombie piece. MaxGCZombieTime int64 = 600 // MinGCMetaTime defines the min timeout to gc meta. MinGCMetaTime int64 = 300 // MaxGCMetaTime defines the max timeout to gc meta. MaxGCMetaTime int64 = 600 // MinRecoveryTime defines the min timeout to recovery object. MinRecoveryTime int64 = 10 // MaxRecoveryTime defines the max timeout to replicate object. MaxRecoveryTime int64 = 50 // MinMigrateGVGTime defines the min timeout to migrate gvg. MinMigrateGVGTime int64 = 1800 // 0.5 hour // MaxMigrateGVGTime defines the max timeout to migrate gvg. MaxMigrateGVGTime int64 = 3600 // 1 hour // MinGCBucketMigrationTime defines the min timeout to gc bucket migration. MinGCBucketMigrationTime int64 = 1800 // 0.5 hour // MaxGCBucketMigrationTime defines the max timeout to gc bucket migration. MaxGCBucketMigrationTime int64 = 3600 // 1 hour // NotUseRetry defines the default task max retry. NotUseRetry int64 = 0 // MinReplicateRetry defines the min retry number to replicate object. MinReplicateRetry = 3 // MaxReplicateRetry defines the max retry number to replicate object. MaxReplicateRetry = 6 // MinReceiveConfirmRetry defines the min retry number to confirm received piece is sealed on greenfield. MinReceiveConfirmRetry = 1 // MaxReceiveConfirmRetry defines the max retry number to confirm received piece is sealed on greenfield. MaxReceiveConfirmRetry = 3 // MinSealObjectRetry defines the min retry number to seal object. MinSealObjectRetry = 3 // MaxSealObjectRetry defines the max retry number to seal object. MaxSealObjectRetry = 10 // MinGCObjectRetry defines the min retry number to gc object. MinGCObjectRetry = 3 // MaxGCObjectRetry defines the min retry number to gc object. MaxGCObjectRetry = 5 // MinRecoveryRetry defines the min retry number to recovery piece. MinRecoveryRetry = 2 // MaxRecoveryRetry defines the max retry number to recovery piece. MaxRecoveryRetry = 3 // MinMigrateGVGRetry defines the min retry number to migrate gvg. MinMigrateGVGRetry = 2 // MaxMigrateGVGRetry defines the max retry number to migrate gvg. MaxMigrateGVGRetry = 3 // MinGCBucketMigrationRetry defines the min retry number to gc bucket migration. MinGCBucketMigrationRetry = 3 // MaxGCBucketMigrationRetry defines the max retry number to gc bucket migration. MaxGCBucketMigrationRetry = 5 )
const (
BaseCodeSpace = "gfsp-base-app"
)
const (
// DefaultStopTime defines the default timeout for stopping services.
DefaultStopTime = 30
)
const (
// MaxServerCallMsgSize defines the max message size for grpc server
MaxServerCallMsgSize = 3 * 1024 * 1024 * 1024
)
Variables ¶
var ( ErrApprovalTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990101, "OoooH... request lost") ErrApprovalExhaustResource = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990102, "server overload, try again later") )
var ( ErrDownloadTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990301, "OoooH... request lost") ErrDownloadExhaustResource = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990302, "server overload, try again later") )
var ( ErrUploadTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990601, "OoooH... request lost") ErrUnsupportedTaskType = gfsperrors.Register(BaseCodeSpace, http.StatusNotFound, 990602, "unsupported task type") ErrNoTaskMatchLimit = gfsperrors.Register(BaseCodeSpace, http.StatusNotFound, 990603, "no task to dispatch below the require limits") )
var ( ErrReceiveTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990801, "OoooH... request lost") ErrReceiveExhaustResource = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990802, "server overload, try again later") )
var ( ErrUploadObjectDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 991101, "OoooH... request lost") ErrUploadExhaustResource = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 991102, "server overload, try again later") ErrExceptionsStream = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 991103, "stream closed abnormally") )
var (
ErrAuthenticatorTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990101, "OoooH... request lost")
)
var (
ErrFutureSupport = gfsperrors.Register(BaseCodeSpace, http.StatusNotFound, 995301, "future support")
)
var (
ErrReplicatePieceApprovalTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 990701, "OoooH... request lost")
)
var (
ErrSingTaskDangling = gfsperrors.Register(BaseCodeSpace, http.StatusBadRequest, 991001, "OoooH... request lost")
)
Functions ¶
func ClearRegisterModules ¶ added in v0.2.4
func ClearRegisterModules()
ClearRegisterModules clear all map contents
func DefaultGfBsDBOption ¶
func DefaultGfBsDBOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpClientOption ¶
func DefaultGfSpClientOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpConsensusOption ¶
func DefaultGfSpConsensusOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpDBOption ¶
func DefaultGfSpDBOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpMetricOption ¶
func DefaultGfSpMetricOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpModuleOption ¶ added in v0.2.3
func DefaultGfSpModuleOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpPProfOption ¶ added in v0.2.3
func DefaultGfSpPProfOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpPieceOpOption ¶
func DefaultGfSpPieceOpOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpPieceStoreOption ¶
func DefaultGfSpPieceStoreOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpProbeOption ¶ added in v1.1.0
func DefaultGfSpProbeOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpResourceManagerOption ¶
func DefaultGfSpResourceManagerOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGfSpTQueueOption ¶
func DefaultGfSpTQueueOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func DefaultGrpcServerOptions ¶
func DefaultGrpcServerOptions() []grpc.ServerOption
func DefaultStaticOption ¶
func DefaultStaticOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
func GetRegisterModuleDescription ¶ added in v0.2.3
func GetRegisterModuleDescription() string
GetRegisterModuleDescription returns the list registered modules' description.
func GetRegisteredModules ¶ added in v0.2.3
func GetRegisteredModules() []string
GetRegisteredModules returns the registered modules.
func RegisterModular ¶
func RegisterModular(name string, description string, newFunc NewModularFunc)
RegisterModular registers the module info to the global ModularManager
Types ¶
type GfSpBaseApp ¶
type GfSpBaseApp struct {
// contains filtered or unexported fields
}
func NewGfSpBaseApp ¶
func NewGfSpBaseApp(cfg *gfspconfig.GfSpConfig, opts ...gfspconfig.Option) (*GfSpBaseApp, error)
func (*GfSpBaseApp) AppID ¶
func (g *GfSpBaseApp) AppID() string
AppID returns the GfSpBaseApp ID, the default value is prefix(gfsp) add started modules' name.
func (*GfSpBaseApp) ChainID ¶
func (g *GfSpBaseApp) ChainID() string
ChainID returns the chainID used by this sp instance
func (*GfSpBaseApp) Consensus ¶
func (g *GfSpBaseApp) Consensus() consensus.Consensus
Consensus returns greenfield consensus query client.
func (*GfSpBaseApp) EnableMetrics ¶
func (g *GfSpBaseApp) EnableMetrics() bool
EnableMetrics returns an indicator whether enable the metrics service.
func (*GfSpBaseApp) GetAuthNonce ¶
func (g *GfSpBaseApp) GetAuthNonce(ctx context.Context, req *gfspserver.GetAuthNonceRequest) (*gfspserver.GetAuthNonceResponse, error)
GetAuthNonce get the auth nonce for which the Dapp or client can generate EDDSA key pairs.
func (*GfSpBaseApp) GetProbe ¶ added in v1.1.0
func (g *GfSpBaseApp) GetProbe() coreprober.Prober
GetProbe returns the http probe.
func (*GfSpBaseApp) GfBsDB ¶
func (g *GfSpBaseApp) GfBsDB() bsdb.BSDB
GfBsDB returns the block syncer db client.
func (*GfSpBaseApp) GfBsDBMaster ¶
func (g *GfSpBaseApp) GfBsDBMaster() bsdb.BSDB
GfBsDBMaster returns the master block syncer db client.
func (*GfSpBaseApp) GfSpAskApproval ¶
func (g *GfSpBaseApp) GfSpAskApproval(ctx context.Context, req *gfspserver.GfSpAskApprovalRequest) ( *gfspserver.GfSpAskApprovalResponse, error)
func (*GfSpBaseApp) GfSpAskSecondaryReplicatePieceApproval ¶
func (g *GfSpBaseApp) GfSpAskSecondaryReplicatePieceApproval(ctx context.Context, req *gfspserver.GfSpAskSecondaryReplicatePieceApprovalRequest) ( *gfspserver.GfSpAskSecondaryReplicatePieceApprovalResponse, error)
func (*GfSpBaseApp) GfSpAskTask ¶
func (g *GfSpBaseApp) GfSpAskTask(ctx context.Context, req *gfspserver.GfSpAskTaskRequest) (*gfspserver.GfSpAskTaskResponse, error)
func (*GfSpBaseApp) GfSpBeginTask ¶
func (g *GfSpBaseApp) GfSpBeginTask(ctx context.Context, req *gfspserver.GfSpBeginTaskRequest) (*gfspserver.GfSpBeginTaskResponse, error)
func (*GfSpBaseApp) GfSpClient ¶
func (g *GfSpBaseApp) GfSpClient() gfspclient.GfSpClientAPI
GfSpClient returns the sp client that includes inner grpc and outer http protocol.
func (*GfSpBaseApp) GfSpDB ¶
func (g *GfSpBaseApp) GfSpDB() spdb.SPDB
GfSpDB returns the sp db client.
func (*GfSpBaseApp) GfSpDeductQuotaForBucketMigrate ¶ added in v1.1.0
func (g *GfSpBaseApp) GfSpDeductQuotaForBucketMigrate(ctx context.Context, deductQuotaRequest *gfspserver.GfSpDeductQuotaForBucketMigrateRequest) (*gfspserver.GfSpDeductQuotaForBucketMigrateResponse, error)
func (*GfSpBaseApp) GfSpDoneReplicatePiece ¶
func (g *GfSpBaseApp) GfSpDoneReplicatePiece(ctx context.Context, req *gfspserver.GfSpDoneReplicatePieceRequest) ( resp *gfspserver.GfSpDoneReplicatePieceResponse, err error)
func (*GfSpBaseApp) GfSpDownloadObject ¶
func (g *GfSpBaseApp) GfSpDownloadObject(ctx context.Context, req *gfspserver.GfSpDownloadObjectRequest) ( *gfspserver.GfSpDownloadObjectResponse, error)
func (*GfSpBaseApp) GfSpDownloadPiece ¶
func (g *GfSpBaseApp) GfSpDownloadPiece(ctx context.Context, req *gfspserver.GfSpDownloadPieceRequest) ( *gfspserver.GfSpDownloadPieceResponse, error)
func (*GfSpBaseApp) GfSpGetChallengeInfo ¶
func (g *GfSpBaseApp) GfSpGetChallengeInfo(ctx context.Context, req *gfspserver.GfSpGetChallengeInfoRequest) ( *gfspserver.GfSpGetChallengeInfoResponse, error)
func (*GfSpBaseApp) GfSpNotifyMigrateSwapOut ¶ added in v0.2.3
func (g *GfSpBaseApp) GfSpNotifyMigrateSwapOut(ctx context.Context, req *gfspserver.GfSpNotifyMigrateSwapOutRequest) ( *gfspserver.GfSpNotifyMigrateSwapOutResponse, error)
func (*GfSpBaseApp) GfSpNotifyPostMigrate ¶ added in v1.1.0
func (g *GfSpBaseApp) GfSpNotifyPostMigrate(ctx context.Context, req *gfspserver.GfSpNotifyPostMigrateBucketRequest) ( *gfspserver.GfSpNotifyPostMigrateBucketResponse, error)
func (*GfSpBaseApp) GfSpNotifyPreMigrate ¶ added in v1.1.0
func (g *GfSpBaseApp) GfSpNotifyPreMigrate(ctx context.Context, req *gfspserver.GfSpNotifyPreMigrateBucketRequest) ( *gfspserver.GfSpNotifyPreMigrateBucketResponse, error)
func (*GfSpBaseApp) GfSpPickVirtualGroupFamily ¶ added in v0.2.3
func (g *GfSpBaseApp) GfSpPickVirtualGroupFamily(ctx context.Context, req *gfspserver.GfSpPickVirtualGroupFamilyRequest) ( *gfspserver.GfSpPickVirtualGroupFamilyResponse, error)
func (*GfSpBaseApp) GfSpQueryBucketMigrate ¶ added in v0.2.3
func (g *GfSpBaseApp) GfSpQueryBucketMigrate(ctx context.Context, req *gfspserver.GfSpQueryBucketMigrateRequest) ( *gfspserver.GfSpQueryBucketMigrateResponse, error)
func (*GfSpBaseApp) GfSpQueryP2PBootstrap ¶
func (g *GfSpBaseApp) GfSpQueryP2PBootstrap(ctx context.Context, req *gfspserver.GfSpQueryP2PNodeRequest) ( *gfspserver.GfSpQueryP2PNodeResponse, error)
func (*GfSpBaseApp) GfSpQueryResourceLimit ¶
func (g *GfSpBaseApp) GfSpQueryResourceLimit(context.Context, *gfspserver.GfSpQueryResourceLimitRequest) ( *gfspserver.GfSpQueryResourceLimitResponse, error)
func (*GfSpBaseApp) GfSpQuerySpExit ¶ added in v0.2.3
func (g *GfSpBaseApp) GfSpQuerySpExit(ctx context.Context, req *gfspserver.GfSpQuerySpExitRequest) ( *gfspserver.GfSpQuerySpExitResponse, error)
func (*GfSpBaseApp) GfSpQueryTasks ¶
func (g *GfSpBaseApp) GfSpQueryTasks(ctx context.Context, req *gfspserver.GfSpQueryTasksRequest) ( *gfspserver.GfSpQueryTasksResponse, error)
func (*GfSpBaseApp) GfSpQueryTasksStats ¶ added in v0.2.6
func (g *GfSpBaseApp) GfSpQueryTasksStats(ctx context.Context, _ *gfspserver.GfSpQueryTasksStatsRequest) ( *gfspserver.GfSpQueryTasksStatsResponse, error)
func (*GfSpBaseApp) GfSpReimburseQuota ¶ added in v0.2.5
func (g *GfSpBaseApp) GfSpReimburseQuota(ctx context.Context, fixRequest *gfspserver.GfSpReimburseQuotaRequest) (*gfspserver.GfSpReimburseQuotaResponse, error)
func (*GfSpBaseApp) GfSpReplicatePiece ¶
func (g *GfSpBaseApp) GfSpReplicatePiece(ctx context.Context, req *gfspserver.GfSpReplicatePieceRequest) ( resp *gfspserver.GfSpReplicatePieceResponse, err error)
func (*GfSpBaseApp) GfSpReportTask ¶
func (g *GfSpBaseApp) GfSpReportTask(ctx context.Context, req *gfspserver.GfSpReportTaskRequest) ( *gfspserver.GfSpReportTaskResponse, error)
func (*GfSpBaseApp) GfSpResetRecoveryFailedList ¶ added in v1.1.0
func (g *GfSpBaseApp) GfSpResetRecoveryFailedList(ctx context.Context, _ *gfspserver.GfSpResetRecoveryFailedListRequest) ( *gfspserver.GfSpResetRecoveryFailedListResponse, error)
func (*GfSpBaseApp) GfSpResumableUploadObject ¶ added in v0.2.3
func (g *GfSpBaseApp) GfSpResumableUploadObject(stream gfspserver.GfSpUploadService_GfSpResumableUploadObjectServer) error
func (*GfSpBaseApp) GfSpSetResourceLimit ¶
func (g *GfSpBaseApp) GfSpSetResourceLimit(context.Context, *gfspserver.GfSpSetResourceLimitRequest) ( *gfspserver.GfSpSetResourceLimitResponse, error)
func (*GfSpBaseApp) GfSpSign ¶
func (g *GfSpBaseApp) GfSpSign(ctx context.Context, req *gfspserver.GfSpSignRequest) (*gfspserver.GfSpSignResponse, error)
func (*GfSpBaseApp) GfSpUploadObject ¶
func (g *GfSpBaseApp) GfSpUploadObject(stream gfspserver.GfSpUploadService_GfSpUploadObjectServer) error
func (*GfSpBaseApp) GfSpVerifyAuthentication ¶
func (g *GfSpBaseApp) GfSpVerifyAuthentication(ctx context.Context, req *gfspserver.GfSpAuthenticationRequest) ( *gfspserver.GfSpAuthenticationResponse, error)
func (*GfSpBaseApp) OnAskCreateBucketApproval ¶
func (g *GfSpBaseApp) OnAskCreateBucketApproval(ctx context.Context, task task.ApprovalCreateBucketTask) (allow bool, err error)
func (*GfSpBaseApp) OnAskCreateObjectApproval ¶
func (g *GfSpBaseApp) OnAskCreateObjectApproval(ctx context.Context, task task.ApprovalCreateObjectTask) (allow bool, err error)
func (*GfSpBaseApp) OnAskMigrateBucketApproval ¶ added in v0.2.3
func (g *GfSpBaseApp) OnAskMigrateBucketApproval(ctx context.Context, task task.ApprovalMigrateBucketTask) (bool, error)
func (*GfSpBaseApp) OnBeginResumableUploadObjectTask ¶ added in v0.2.3
func (g *GfSpBaseApp) OnBeginResumableUploadObjectTask(ctx context.Context, task coretask.ResumableUploadObjectTask) error
func (*GfSpBaseApp) OnBeginUploadObjectTask ¶
func (g *GfSpBaseApp) OnBeginUploadObjectTask(ctx context.Context, task coretask.UploadObjectTask) (err error)
func (*GfSpBaseApp) OnChallengePieceTask ¶
func (g *GfSpBaseApp) OnChallengePieceTask(ctx context.Context, challengePieceTask task.ChallengePieceTask) ( integrity []byte, checksums [][]byte, data []byte, err error)
func (*GfSpBaseApp) OnDownloadObjectTask ¶
func (g *GfSpBaseApp) OnDownloadObjectTask(ctx context.Context, downloadObjectTask task.DownloadObjectTask) ([]byte, error)
func (*GfSpBaseApp) OnDownloadPieceTask ¶
func (g *GfSpBaseApp) OnDownloadPieceTask(ctx context.Context, downloadPieceTask task.DownloadPieceTask) ( data []byte, err error)
func (*GfSpBaseApp) OperatorAddress ¶
func (g *GfSpBaseApp) OperatorAddress() string
OperatorAddress returns the sp operator address.
func (*GfSpBaseApp) PieceOp ¶
func (g *GfSpBaseApp) PieceOp() piecestore.PieceOp
PieceOp returns piece helper struct instance.
func (*GfSpBaseApp) PieceStore ¶
func (g *GfSpBaseApp) PieceStore() piecestore.PieceStore
PieceStore returns the piece store client.
func (*GfSpBaseApp) RegisterServices ¶
func (g *GfSpBaseApp) RegisterServices(services ...corelifecycle.Service)
RegisterServices register services of an application.
func (*GfSpBaseApp) ResourceManager ¶
func (g *GfSpBaseApp) ResourceManager() corercmgr.ResourceManager
ResourceManager returns the resource manager for module to open own resource span.
func (*GfSpBaseApp) ServerForRegister ¶
func (g *GfSpBaseApp) ServerForRegister() *grpc.Server
ServerForRegister returns the Grpc server for module register own service.
func (*GfSpBaseApp) SetAppID ¶ added in v0.2.5
func (g *GfSpBaseApp) SetAppID(appID string)
SetAppID sets appID
func (*GfSpBaseApp) SetChainID ¶ added in v0.2.5
func (g *GfSpBaseApp) SetChainID(chainID string)
SetChainID sets chainID
func (*GfSpBaseApp) SetConsensus ¶ added in v0.2.5
func (g *GfSpBaseApp) SetConsensus(chain consensus.Consensus)
SetConsensus sets greenfield consensus query client.
func (*GfSpBaseApp) SetGfBsDB ¶
func (g *GfSpBaseApp) SetGfBsDB(setDB bsdb.BSDB)
SetGfBsDB sets the block syncer db client.
func (*GfSpBaseApp) SetGfSpClient ¶ added in v0.2.5
func (g *GfSpBaseApp) SetGfSpClient(clientAPI gfspclient.GfSpClientAPI)
SetGfSpClient sets gfsp client
func (*GfSpBaseApp) SetGfSpDB ¶ added in v0.2.5
func (g *GfSpBaseApp) SetGfSpDB(db spdb.SPDB)
SetGfSpDB sets spdb
func (*GfSpBaseApp) SetOperatorAddress ¶ added in v0.2.5
func (g *GfSpBaseApp) SetOperatorAddress(operatorAddress string)
SetOperatorAddress sets operator address
func (*GfSpBaseApp) SetPieceOp ¶ added in v0.2.5
func (g *GfSpBaseApp) SetPieceOp(pieceOp piecestore.PieceOp)
SetPieceOp sets piece op
func (*GfSpBaseApp) SetPieceStore ¶ added in v0.2.5
func (g *GfSpBaseApp) SetPieceStore(ps piecestore.PieceStore)
SetPieceStore sets piece store
func (*GfSpBaseApp) SetProbe ¶ added in v1.1.0
func (g *GfSpBaseApp) SetProbe(prober coreprober.Prober)
SetProbe sets the http probe.
func (*GfSpBaseApp) SetResourceManager ¶ added in v0.2.5
func (g *GfSpBaseApp) SetResourceManager(rcmgr corercmgr.ResourceManager)
SetResourceManager sets the resource manager for module to open own resource span.
func (*GfSpBaseApp) Signals ¶
func (g *GfSpBaseApp) Signals(sigs ...os.Signal) corelifecycle.Lifecycle
Signals registers monitor signals.
func (*GfSpBaseApp) Start ¶
func (g *GfSpBaseApp) Start(ctx context.Context) error
Start the GfSpBaseApp and blocks the progress until signal.
func (*GfSpBaseApp) StartRPCServer ¶
func (g *GfSpBaseApp) StartRPCServer(ctx context.Context) error
func (*GfSpBaseApp) StartServices ¶
func (g *GfSpBaseApp) StartServices(ctx context.Context) corelifecycle.Lifecycle
StartServices starts running services.
func (*GfSpBaseApp) StopRPCServer ¶
func (g *GfSpBaseApp) StopRPCServer(ctx context.Context) error
func (*GfSpBaseApp) StopServices ¶
func (g *GfSpBaseApp) StopServices(ctx context.Context)
StopServices stop services when context is done or timeout.
func (*GfSpBaseApp) TaskMaxRetry ¶
func (g *GfSpBaseApp) TaskMaxRetry(task coretask.Task) int64
TaskMaxRetry returns the task max retry by task type.
func (*GfSpBaseApp) TaskPriority ¶
func (g *GfSpBaseApp) TaskPriority(task coretask.Task) coretask.TPriority
TaskPriority returns the task priority by task type, it is the default options. the task priority support self define and dynamic settings.
func (*GfSpBaseApp) TaskPriorityLevel ¶
func (g *GfSpBaseApp) TaskPriorityLevel(task coretask.Task) coretask.TPriorityLevel
TaskPriorityLevel returns the task priority level, it is computed by task priority.
func (*GfSpBaseApp) TaskTimeout ¶
func (g *GfSpBaseApp) TaskTimeout(task coretask.Task, size uint64) int64
TaskTimeout returns the task timeout by task type and some task need payload size to compute, example: upload, download, etc.
func (*GfSpBaseApp) UpdateUserPublicKey ¶
func (g *GfSpBaseApp) UpdateUserPublicKey(ctx context.Context, req *gfspserver.UpdateUserPublicKeyRequest) (*gfspserver.UpdateUserPublicKeyResponse, error)
UpdateUserPublicKey updates the user public key once the Dapp or client generates the EDDSA key pairs.
func (*GfSpBaseApp) VerifyGNFD1EddsaSignature ¶ added in v0.2.4
func (g *GfSpBaseApp) VerifyGNFD1EddsaSignature(ctx context.Context, req *gfspserver.VerifyGNFD1EddsaSignatureRequest) (*gfspserver.VerifyGNFD1EddsaSignatureResponse, error)
VerifyGNFD1EddsaSignature verifies the signature signed by user's EDDSA private key.
func (*GfSpBaseApp) Wait ¶
func (g *GfSpBaseApp) Wait(ctx context.Context)
Wait blocks until context is done.
type MockgRPCResumableUploadStream ¶ added in v0.2.5
type MockgRPCResumableUploadStream struct {
// contains filtered or unexported fields
}
MockgRPCResumableUploadStream is a mock of gRPCResumableUploadStream interface.
func NewMockgRPCResumableUploadStream ¶ added in v0.2.5
func NewMockgRPCResumableUploadStream(ctrl *gomock.Controller) *MockgRPCResumableUploadStream
NewMockgRPCResumableUploadStream creates a new mock instance.
func (*MockgRPCResumableUploadStream) Context ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) Context() context.Context
Context mocks base method.
func (*MockgRPCResumableUploadStream) EXPECT ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) EXPECT() *MockgRPCResumableUploadStreamMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockgRPCResumableUploadStream) Recv ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) Recv() (*gfspserver.GfSpResumableUploadObjectRequest, error)
Recv mocks base method.
func (*MockgRPCResumableUploadStream) RecvMsg ¶ added in v0.2.5
func (m_2 *MockgRPCResumableUploadStream) RecvMsg(m any) error
RecvMsg mocks base method.
func (*MockgRPCResumableUploadStream) SendAndClose ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) SendAndClose(arg0 *gfspserver.GfSpResumableUploadObjectResponse) error
SendAndClose mocks base method.
func (*MockgRPCResumableUploadStream) SendHeader ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) SendHeader(arg0 metadata.MD) error
SendHeader mocks base method.
func (*MockgRPCResumableUploadStream) SendMsg ¶ added in v0.2.5
func (m_2 *MockgRPCResumableUploadStream) SendMsg(m any) error
SendMsg mocks base method.
func (*MockgRPCResumableUploadStream) SetHeader ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) SetHeader(arg0 metadata.MD) error
SetHeader mocks base method.
func (*MockgRPCResumableUploadStream) SetTrailer ¶ added in v0.2.5
func (m *MockgRPCResumableUploadStream) SetTrailer(arg0 metadata.MD)
SetTrailer mocks base method.
type MockgRPCResumableUploadStreamMockRecorder ¶ added in v0.2.5
type MockgRPCResumableUploadStreamMockRecorder struct {
// contains filtered or unexported fields
}
MockgRPCResumableUploadStreamMockRecorder is the mock recorder for MockgRPCResumableUploadStream.
func (*MockgRPCResumableUploadStreamMockRecorder) Context ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockgRPCResumableUploadStreamMockRecorder) Recv ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) Recv() *gomock.Call
Recv indicates an expected call of Recv.
func (*MockgRPCResumableUploadStreamMockRecorder) RecvMsg ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) RecvMsg(m any) *gomock.Call
RecvMsg indicates an expected call of RecvMsg.
func (*MockgRPCResumableUploadStreamMockRecorder) SendAndClose ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) SendAndClose(arg0 any) *gomock.Call
SendAndClose indicates an expected call of SendAndClose.
func (*MockgRPCResumableUploadStreamMockRecorder) SendHeader ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) SendHeader(arg0 any) *gomock.Call
SendHeader indicates an expected call of SendHeader.
func (*MockgRPCResumableUploadStreamMockRecorder) SendMsg ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) SendMsg(m any) *gomock.Call
SendMsg indicates an expected call of SendMsg.
func (*MockgRPCResumableUploadStreamMockRecorder) SetHeader ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) SetHeader(arg0 any) *gomock.Call
SetHeader indicates an expected call of SetHeader.
func (*MockgRPCResumableUploadStreamMockRecorder) SetTrailer ¶ added in v0.2.5
func (mr *MockgRPCResumableUploadStreamMockRecorder) SetTrailer(arg0 any) *gomock.Call
SetTrailer indicates an expected call of SetTrailer.
type MockgRPCUploadStream ¶ added in v0.2.5
type MockgRPCUploadStream struct {
// contains filtered or unexported fields
}
MockgRPCUploadStream is a mock of gRPCUploadStream interface.
func NewMockgRPCUploadStream ¶ added in v0.2.5
func NewMockgRPCUploadStream(ctrl *gomock.Controller) *MockgRPCUploadStream
NewMockgRPCUploadStream creates a new mock instance.
func (*MockgRPCUploadStream) Context ¶ added in v0.2.5
func (m *MockgRPCUploadStream) Context() context.Context
Context mocks base method.
func (*MockgRPCUploadStream) EXPECT ¶ added in v0.2.5
func (m *MockgRPCUploadStream) EXPECT() *MockgRPCUploadStreamMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockgRPCUploadStream) Recv ¶ added in v0.2.5
func (m *MockgRPCUploadStream) Recv() (*gfspserver.GfSpUploadObjectRequest, error)
Recv mocks base method.
func (*MockgRPCUploadStream) RecvMsg ¶ added in v0.2.5
func (m_2 *MockgRPCUploadStream) RecvMsg(m any) error
RecvMsg mocks base method.
func (*MockgRPCUploadStream) SendAndClose ¶ added in v0.2.5
func (m *MockgRPCUploadStream) SendAndClose(arg0 *gfspserver.GfSpUploadObjectResponse) error
SendAndClose mocks base method.
func (*MockgRPCUploadStream) SendHeader ¶ added in v0.2.5
func (m *MockgRPCUploadStream) SendHeader(arg0 metadata.MD) error
SendHeader mocks base method.
func (*MockgRPCUploadStream) SendMsg ¶ added in v0.2.5
func (m_2 *MockgRPCUploadStream) SendMsg(m any) error
SendMsg mocks base method.
func (*MockgRPCUploadStream) SetHeader ¶ added in v0.2.5
func (m *MockgRPCUploadStream) SetHeader(arg0 metadata.MD) error
SetHeader mocks base method.
func (*MockgRPCUploadStream) SetTrailer ¶ added in v0.2.5
func (m *MockgRPCUploadStream) SetTrailer(arg0 metadata.MD)
SetTrailer mocks base method.
type MockgRPCUploadStreamMockRecorder ¶ added in v0.2.5
type MockgRPCUploadStreamMockRecorder struct {
// contains filtered or unexported fields
}
MockgRPCUploadStreamMockRecorder is the mock recorder for MockgRPCUploadStream.
func (*MockgRPCUploadStreamMockRecorder) Context ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockgRPCUploadStreamMockRecorder) Recv ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) Recv() *gomock.Call
Recv indicates an expected call of Recv.
func (*MockgRPCUploadStreamMockRecorder) RecvMsg ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) RecvMsg(m any) *gomock.Call
RecvMsg indicates an expected call of RecvMsg.
func (*MockgRPCUploadStreamMockRecorder) SendAndClose ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) SendAndClose(arg0 any) *gomock.Call
SendAndClose indicates an expected call of SendAndClose.
func (*MockgRPCUploadStreamMockRecorder) SendHeader ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) SendHeader(arg0 any) *gomock.Call
SendHeader indicates an expected call of SendHeader.
func (*MockgRPCUploadStreamMockRecorder) SendMsg ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) SendMsg(m any) *gomock.Call
SendMsg indicates an expected call of SendMsg.
func (*MockgRPCUploadStreamMockRecorder) SetHeader ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) SetHeader(arg0 any) *gomock.Call
SetHeader indicates an expected call of SetHeader.
func (*MockgRPCUploadStreamMockRecorder) SetTrailer ¶ added in v0.2.5
func (mr *MockgRPCUploadStreamMockRecorder) SetTrailer(arg0 any) *gomock.Call
SetTrailer indicates an expected call of SetTrailer.
type ModularManager ¶
type ModularManager struct {
// contains filtered or unexported fields
}
ModularManager manages the modules, record the module info, module info include: module name, module description and new module func. Module name is an indexer for starting, the start module name comes from config file or '--service' command flag. Module description uses for 'list' command that shows the SP supports modules info. New module func is help module manager to init the module instance.
type NewModularFunc ¶
type NewModularFunc = func(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
NewModularFunc defines the module new instance func type.
func GetNewModularFunc ¶
func GetNewModularFunc(name string) NewModularFunc
GetNewModularFunc returns the list registered module's new instances func.
type Option ¶
type Option func(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error
Option defines the GfSpBaseApp and module init options func type.