Documentation
¶
Index ¶
- func AuthValidityWindow(ot credentials.OperatorType) time.Duration
- func GetQuotaJSON(ot credentials.OperatorType) (json.RawMessage, error)
- type AuthenticationError
- type AuthorizationError
- type OperatorInfo
- type Service
- func (s *Service) CreateCredential(msg []byte, sig []byte, expectedNodeId common.Address, ...) (*models.AuthenticatedCredential, error)
- func (s *Service) CreateCredentialWithRetry(msg []byte, sig []byte, expectedNodeId common.Address, ...) (*models.AuthenticatedCredential, error)
- func (s *Service) Deinit()
- func (s *Service) GetOperatorInfo(msg []byte, sig []byte, expectedNodeId common.Address, ...) (*OperatorInfo, error)
- func (s *Service) Init() error
- type ServiceConfig
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthValidityWindow ¶
func AuthValidityWindow(ot credentials.OperatorType) time.Duration
func GetQuotaJSON ¶
func GetQuotaJSON(ot credentials.OperatorType) (json.RawMessage, error)
Types ¶
type AuthenticationError ¶
type AuthenticationError struct {
// contains filtered or unexported fields
}
func (*AuthenticationError) Error ¶
func (a *AuthenticationError) Error() string
func (*AuthenticationError) Is ¶
func (a *AuthenticationError) Is(err error) bool
type AuthorizationError ¶
type AuthorizationError struct {
// contains filtered or unexported fields
}
func (*AuthorizationError) Error ¶
func (a *AuthorizationError) Error() string
func (*AuthorizationError) Is ¶
func (a *AuthorizationError) Is(err error) bool
type OperatorInfo ¶
type OperatorInfo struct {
CredentialEvents []int64 `json:"credentialEvents"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Services contain business logic, are responsible for interacting with the database, and with external services. They are called by the API handlers.
func NewService ¶
func NewService(config *ServiceConfig) *Service
func (*Service) CreateCredential ¶
func (s *Service) CreateCredential(msg []byte, sig []byte, expectedNodeId common.Address, ot credentials.OperatorType) (*models.AuthenticatedCredential, error)
Creates a new credential for a node. If a valid credential exists, it will be returned instead. No retry logic is implemented, so it is up to the caller to retry if it does not succeed.
func (*Service) CreateCredentialWithRetry ¶
func (s *Service) CreateCredentialWithRetry(msg []byte, sig []byte, expectedNodeId common.Address, ot credentials.OperatorType) (*models.AuthenticatedCredential, error)
Creates a new credential for a node. If a valid credential already exists, it will be returned instead. This method will retry if creating a credential fails.
func (*Service) GetOperatorInfo ¶
func (s *Service) GetOperatorInfo(msg []byte, sig []byte, expectedNodeId common.Address, ot credentials.OperatorType) (*OperatorInfo, error)
type ServiceConfig ¶
type ServiceConfig struct { DB *sql.DB CM *creds.CredentialManager Nodes *models.NodeRegistry WithdrawalAddresses *models.NodeRegistry Logger *zap.Logger Clock clockwork.Clock EnableSoloValidators bool RescueProxyAddr string RescueProxySecureGRPC bool }
ServiceConfig contains the configuration for a Service.
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (*ValidationError) Error ¶
func (v *ValidationError) Error() string
func (*ValidationError) Is ¶
func (v *ValidationError) Is(err error) bool
Click to show internal directories.
Click to hide internal directories.