Documentation ¶
Index ¶
- func CreateEvent[S *models.EventInterface](payload entities.ClientPayload, ctx *context.Context) (model S, err error)
- func GetAccountAuthorizations(auth *entities.Authorization) (*[]models.AuthorizationState, error)
- func GetAccountSubscriptions(payload entities.ClientPayload) (*[]models.TopicState, error)
- func GetAccountSubscriptionsV2(payload entities.Subscription) (*[]models.TopicState, error)
- func GetAuthorizationEventByHash(hash string) (*models.AuthorizationEvent, error)
- func GetAuthorizationEventById(id string) (*models.AuthorizationEvent, error)
- func GetBlockStats() (*[]models.BlockStat, error)
- func GetEvent(eventId string, eventType int) (model interface{}, err error)
- func GetEventByHash(eventHash string, eventType int) (model interface{}, err error)
- func GetEventModelFromEventType(eventType constants.EventType) any
- func GetEventTypeFromModel(eventType entities.EntityModel) constants.EventType
- func GetMainStats(cfg *configs.MainConfiguration) (*entities.MainStat, error)
- func GetMessageEventByHash(hash string) (*models.MessageEvent, error)
- func GetMessageEventById(id string) (*models.MessageEvent, error)
- func GetMessages(topicId string) (*[]models.MessageState, error)
- func GetSubEventByHash(hash string) (*models.SubscriptionEvent, error)
- func GetSubEventById(id string) (*models.SubscriptionEvent, error)
- func GetSubnetByHash(hash string) (*models.SubnetState, error)
- func GetSubnetById(id string) (*models.SubnetState, error)
- func GetSubnetEventByHash(hash string) (*models.SubnetEvent, error)
- func GetSubnetEventById(id string) (*models.SubnetEvent, error)
- func GetSubnetEvents() (*[]models.SubnetEvent, error)
- func GetSubnets(item models.SubnetState) (*[]models.SubnetState, error)
- func GetSubscribedSubnets(item models.SubnetState) (*[]models.SubnetState, error)
- func GetSubscription(id string) (*models.SubscriptionState, error)
- func GetSubscriptions(payload entities.Subscription) (*[]models.SubscriptionState, error)
- func GetTopicEventByHash(hash string) (*models.TopicEvent, error)
- func GetTopicEventById(id string) (*models.TopicEvent, error)
- func GetWalletByHash(hash string) (*models.WalletState, error)
- func GetWalletById(id string) (*models.WalletState, error)
- func GetWalletEventById(id string) (*models.WalletEvent, error)
- func GetWalletEvents() (*[]models.WalletEvent, error)
- func GetWallets() (*[]models.WalletState, error)
- func SyncAgent(req *entities.SyncRequest, clientPayload *entities.ClientPayload) (entities.SyncResponse, error)
- func SyncRequest(payload *entities.ClientPayload) entities.SyncResponse
- func ValidateAuthPayloadData(cfg *configs.MainConfiguration, payload entities.ClientPayload) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- func ValidateClientPayload(payload *entities.ClientPayload, strictAuth bool, chainId configs.ChainId) (*models.AuthorizationState, *entities.DeviceString, error)
- func ValidateMessagePayload(payload entities.ClientPayload, currentAuthState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- func ValidateSubnetPayload(payload entities.ClientPayload, authState *models.AuthorizationState, ...) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- func ValidateSubscriptionPayload(payload entities.ClientPayload, authState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- func ValidateTopicPayload(payload entities.ClientPayload, authState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- func ValidateWalletPayload(payload entities.ClientPayload, authState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, ...)
- type Flag
- type MessageService
- type NodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEvent ¶
func CreateEvent[S *models.EventInterface](payload entities.ClientPayload, ctx *context.Context) (model S, err error)
func GetAccountAuthorizations ¶
func GetAccountAuthorizations(auth *entities.Authorization) (*[]models.AuthorizationState, error)
func GetAccountSubscriptions ¶
func GetAccountSubscriptions(payload entities.ClientPayload) (*[]models.TopicState, error)
func GetAccountSubscriptionsV2 ¶ added in v1.2.0
func GetAccountSubscriptionsV2(payload entities.Subscription) (*[]models.TopicState, error)
func GetAuthorizationEventByHash ¶ added in v1.2.0
func GetAuthorizationEventByHash(hash string) (*models.AuthorizationEvent, error)
func GetAuthorizationEventById ¶
func GetAuthorizationEventById(id string) (*models.AuthorizationEvent, error)
func GetBlockStats ¶
func GetEventByHash ¶ added in v1.2.0
func GetEventModelFromEventType ¶ added in v1.2.0
func GetEventTypeFromModel ¶ added in v1.2.0
func GetEventTypeFromModel(eventType entities.EntityModel) constants.EventType
func GetMainStats ¶
func GetMainStats(cfg *configs.MainConfiguration) (*entities.MainStat, error)
func GetMessageEventByHash ¶ added in v1.2.0
func GetMessageEventByHash(hash string) (*models.MessageEvent, error)
func GetMessageEventById ¶
func GetMessageEventById(id string) (*models.MessageEvent, error)
func GetMessages ¶
func GetMessages(topicId string) (*[]models.MessageState, error)
func GetSubEventByHash ¶ added in v1.2.0
func GetSubEventByHash(hash string) (*models.SubscriptionEvent, error)
func GetSubEventById ¶
func GetSubEventById(id string) (*models.SubscriptionEvent, error)
func GetSubnetByHash ¶
func GetSubnetByHash(hash string) (*models.SubnetState, error)
func GetSubnetById ¶
func GetSubnetById(id string) (*models.SubnetState, error)
func GetSubnetEventByHash ¶ added in v1.2.0
func GetSubnetEventByHash(hash string) (*models.SubnetEvent, error)
func GetSubnetEventById ¶
func GetSubnetEventById(id string) (*models.SubnetEvent, error)
func GetSubnetEvents ¶
func GetSubnetEvents() (*[]models.SubnetEvent, error)
func GetSubnets ¶
func GetSubnets(item models.SubnetState) (*[]models.SubnetState, error)
func GetSubscribedSubnets ¶ added in v1.2.0
func GetSubscribedSubnets(item models.SubnetState) (*[]models.SubnetState, error)
func GetSubscription ¶
func GetSubscription(id string) (*models.SubscriptionState, error)
func GetSubscriptions ¶
func GetSubscriptions(payload entities.Subscription) (*[]models.SubscriptionState, error)
func GetTopicEventByHash ¶ added in v1.2.0
func GetTopicEventByHash(hash string) (*models.TopicEvent, error)
func GetTopicEventById ¶
func GetTopicEventById(id string) (*models.TopicEvent, error)
func GetWalletByHash ¶
func GetWalletByHash(hash string) (*models.WalletState, error)
func GetWalletById ¶
func GetWalletById(id string) (*models.WalletState, error)
func GetWalletEventById ¶ added in v1.2.0
func GetWalletEventById(id string) (*models.WalletEvent, error)
func GetWalletEvents ¶
func GetWalletEvents() (*[]models.WalletEvent, error)
func GetWallets ¶
func GetWallets() (*[]models.WalletState, error)
func SyncAgent ¶
func SyncAgent(req *entities.SyncRequest, clientPayload *entities.ClientPayload) (entities.SyncResponse, error)
func SyncAgent(req *entities.SyncRequest, clientPayload *entities.ClientPayload) (entities.SyncResponse, error) {
func SyncRequest ¶
func SyncRequest(payload *entities.ClientPayload) entities.SyncResponse
func ValidateAuthPayloadData ¶ added in v1.2.0
func ValidateAuthPayloadData(cfg *configs.MainConfiguration, payload entities.ClientPayload) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error)
func ValidateClientPayload ¶
func ValidateClientPayload( payload *entities.ClientPayload, strictAuth bool, chainId configs.ChainId, ) (*models.AuthorizationState, *entities.DeviceString, error)
func ValidateMessagePayload ¶
func ValidateMessagePayload(payload entities.ClientPayload, currentAuthState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error)
func ValidateSubnetPayload ¶
func ValidateSubnetPayload(payload entities.ClientPayload, authState *models.AuthorizationState, ctx *context.Context) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error)
incomingSubnetC, ok := (*mainCtx).Value(constants.IncomingSubnetEventChId).(*chan *entities.Event) if !ok { logger.Errorf("incomingSubnetC closed") return } for { event, ok := <-*incomingSubnetC if !ok { logger.Fatal("incomingSubnetC closed for read") return } go service.HandleNewPubSubSubnetEvent(event, ctx) } }
func ValidateSubscriptionPayload ¶
func ValidateSubscriptionPayload(payload entities.ClientPayload, authState *models.AuthorizationState) ( assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error, )
func ValidateTopicPayload ¶
func ValidateTopicPayload(payload entities.ClientPayload, authState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error)
incomingTopicC, ok := (*mainCtx).Value(constants.IncomingTopicEventChId).(*chan *entities.Event) if !ok { logger.Errorf("incomingTopicC closed") return } for { event, ok := <-*incomingTopicC if !ok { logger.Fatal("incomingTopicC closed for read") return } go service.HandleNewPubSubTopicEvent(event, ctx) } }
func ValidateWalletPayload ¶
func ValidateWalletPayload(payload entities.ClientPayload, authState *models.AuthorizationState) (assocPrevEvent *entities.EventPath, assocAuthEvent *entities.EventPath, err error)
incomingWalletC, ok := (*mainCtx).Value(constants.IncomingWalletEventChId).(*chan *entities.Event) if !ok { logger.Errorf("incomingWalletC closed") return } for { event, ok := <-*incomingWalletC if !ok { logger.Fatal("incomingWalletC closed for read") return } go service.HandleNewPubSubWalletEvent(event, ctx) } }
Types ¶
type MessageService ¶
type MessageService struct { Ctx context.Context Cfg configs.MainConfiguration }
func NewMessageService ¶
func NewMessageService(mainCtx *context.Context) *MessageService
type NodeInfo ¶ added in v1.2.0
type NodeInfo struct { Account string `json:"account"` NodeType constants.NodeType `json:"node_type"` NodePublicKey string `json:"node_pubkey"` // ChainPublicKey string `json:"chain_pubkey"` ChainId string `json:"chain_id"` CurrentCycle uint64 `json:"current_cycle"` CurrentBlock uint64 `json:"current_block"` CurrentEpoch uint64 `json:"current_epoch"` Listeners []string `json:"listeners"` }
Click to show internal directories.
Click to hide internal directories.