challenge

package
v0.1.0-fix-4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Challenge

type Challenge struct {
	// contains filtered or unexported fields
}

Challenge implements the gRPC of ChallengeService, responsible for handling challenge piece request.

func NewChallengeService

func NewChallengeService(cfg *ChallengeConfig) (*Challenge, error)

NewChallengeService returns an instance of Challenge that implementation of the lifecycle.Service and ChallengeService interface

func (*Challenge) ChallengePiece

func (challenge *Challenge) ChallengePiece(ctx context.Context, req *types.ChallengePieceRequest) (*types.ChallengePieceResponse, error)

ChallengePiece handles the piece challenge request return the piece's integrity hash, piece hash and piece data

func (*Challenge) Name

func (challenge *Challenge) Name() string

Name return the challenge service name, for the lifecycle management

func (*Challenge) Start

func (challenge *Challenge) Start(ctx context.Context) error

Start the challenge gRPC service

func (*Challenge) Stop

func (challenge *Challenge) Stop(ctx context.Context) error

Stop the challenge gRPC service and recycle the resources

type ChallengeConfig

type ChallengeConfig struct {
	GRPCAddress      string
	SpDBConfig       *config.SQLDBConfig
	PieceStoreConfig *storage.PieceStoreConfig
}

ChallengeConfig defines challenge service config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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