services

package
v0.0.0-...-4467ad0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

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) Deinit

func (s *Service) Deinit()

func (*Service) GetOperatorInfo

func (s *Service) GetOperatorInfo(msg []byte, sig []byte, expectedNodeId common.Address, ot credentials.OperatorType) (*OperatorInfo, error)

func (*Service) Init

func (s *Service) Init() 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

Jump to

Keyboard shortcuts

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