Documentation
¶
Index ¶
- type Service
- func (s *Service) CreateOracle(ctx context.Context, name, description string, ...) (*models.Oracle, error)
- func (s *Service) CreateOracleRequest(ctx context.Context, oracleID int, userID int, params map[string]interface{}, ...) (*models.OracleRequest, error)
- func (s *Service) DeleteOracle(ctx context.Context, id, userID int) error
- func (s *Service) GetOracle(ctx context.Context, id int) (*models.Oracle, error)
- func (s *Service) GetOracleByName(ctx context.Context, name string) (*models.Oracle, error)
- func (s *Service) GetOracleRequest(ctx context.Context, id int) (*models.OracleRequest, error)
- func (s *Service) GetOracleStatistics(ctx context.Context) (map[string]interface{}, error)
- func (s *Service) ListOracleRequests(ctx context.Context, oracleID int, offset, limit int) ([]*models.OracleRequest, error)
- func (s *Service) ListOracles(ctx context.Context, userID int, offset, limit int) ([]*models.Oracle, error)
- func (s *Service) Start() error
- func (s *Service) Stop()
- func (s *Service) UpdateOracle(ctx context.Context, id int, name, description string, ...) (*models.Oracle, 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 oracle operations
func NewService ¶
func NewService( cfg *config.Config, log *logger.Logger, oracleRepository models.OracleRepository, blockchainClient *blockchain.Client, gasBankService *gasbank.Service, teeManager *tee.Manager, ) *Service
NewService creates a new oracle service
func (*Service) CreateOracle ¶
func (s *Service) CreateOracle( ctx context.Context, name, description string, sourceType models.OracleDataSourceType, url, method string, headers map[string]interface{}, body string, authType models.OracleAuthType, authParams map[string]interface{}, path string, transform string, schedule string, userID int, ) (*models.Oracle, error)
CreateOracle creates a new oracle data source configuration
func (*Service) CreateOracleRequest ¶
func (s *Service) CreateOracleRequest( ctx context.Context, oracleID int, userID int, params map[string]interface{}, callbackAddress string, callbackMethod string, gasFee float64, ) (*models.OracleRequest, error)
CreateOracleRequest creates a new oracle data request
func (*Service) DeleteOracle ¶
DeleteOracle deletes an oracle data source configuration
func (*Service) GetOracleByName ¶
GetOracleByName gets an oracle data source configuration by name
func (*Service) GetOracleRequest ¶
GetOracleRequest gets an oracle data request by ID
func (*Service) GetOracleStatistics ¶
GetOracleStatistics gets statistics for oracle data
func (*Service) ListOracleRequests ¶
func (s *Service) ListOracleRequests(ctx context.Context, oracleID int, offset, limit int) ([]*models.OracleRequest, error)
ListOracleRequests lists oracle data requests for an oracle
func (*Service) ListOracles ¶
func (s *Service) ListOracles(ctx context.Context, userID int, offset, limit int) ([]*models.Oracle, error)
ListOracles lists oracle data source configurations
func (*Service) UpdateOracle ¶
func (s *Service) UpdateOracle( ctx context.Context, id int, name, description string, sourceType models.OracleDataSourceType, url, method string, headers map[string]interface{}, body string, authType models.OracleAuthType, authParams map[string]interface{}, path string, transform string, schedule string, active bool, userID int, ) (*models.Oracle, error)
UpdateOracle updates an oracle data source configuration
Click to show internal directories.
Click to hide internal directories.