Documentation
¶
Index ¶
- type Service
- func (s *Service) CreateRequest(ctx context.Context, userID int, callbackAddress string, callbackMethod string, ...) (*models.RandomRequest, error)
- func (s *Service) GetRandomStatistics(ctx context.Context) (map[string]interface{}, error)
- func (s *Service) GetRequest(ctx context.Context, id int) (*models.RandomRequest, error)
- func (s *Service) ListRequests(ctx context.Context, userID int, offset, limit int) ([]*models.RandomRequest, error)
- func (s *Service) Start() error
- func (s *Service) Stop()
- func (s *Service) VerifyRandomNumber(ctx context.Context, requestID int, randomNumber, proof []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles random number generation operations
func NewService ¶
func NewService( cfg *config.Config, log *logger.Logger, randomRepository models.RandomRepository, blockchainClient *blockchain.Client, teeManager *tee.Manager, ) *Service
NewService creates a new random service
func (*Service) CreateRequest ¶
func (s *Service) CreateRequest( ctx context.Context, userID int, callbackAddress string, callbackMethod string, seed []byte, numBytes int, delayBlocks int, gasFee float64, ) (*models.RandomRequest, error)
CreateRequest creates a new random number request
func (*Service) GetRandomStatistics ¶
GetRandomStatistics gets statistics for random number generation
func (*Service) GetRequest ¶
GetRequest gets a random number request by ID
func (*Service) ListRequests ¶
func (s *Service) ListRequests(ctx context.Context, userID int, offset, limit int) ([]*models.RandomRequest, error)
ListRequests lists random number requests for a user
Click to show internal directories.
Click to hide internal directories.