Documentation ¶
Index ¶
- func AuthorizeAgent(payload entities.ClientPayload, ctx *context.Context) (*models.AuthorizationEvent, error)
- 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 GetAuthorizationEventById(id string) (*models.AuthorizationEvent, error)
- func GetBlockStats() (*[]models.BlockStat, error)
- func GetEvent(eventId string, eventType int) (model interface{}, err error)
- func GetMainStats() (*entities.MainStat, error)
- func GetMessageEventById(id string) (*models.MessageEvent, error)
- func GetMessages(topicId string) (*[]models.MessageState, error)
- func GetSubEventById(id string) (*models.SubscriptionEvent, error)
- func GetSubnetByHash(hash string) (*models.SubnetState, error)
- func GetSubnetById(id string) (*models.SubnetState, error)
- func GetSubnetEventById(id string) (*models.SubnetEvent, error)
- func GetSubnetEvents() (*[]models.SubnetEvent, error)
- func GetSubnets(item models.SubnetState) (*[]models.SubnetState, error)
- func GetSubscription(id string) (*models.SubscriptionState, error)
- func GetSubscriptions(payload entities.Subscription) (*[]models.SubscriptionState, error)
- func GetTopic(where models.TopicState) (*models.TopicState, error)
- func GetTopicByHash(hash string) (*models.TopicState, error)
- func GetTopicById(id string) (*models.TopicState, error)
- func GetTopicEventById(id string) (*models.TopicEvent, error)
- func GetTopicEvents() (*[]models.TopicEvent, error)
- func GetTopics() (*[]models.TopicState, error)
- func GetWalletByHash(hash string) (*models.WalletState, error)
- func GetWalletById(id string) (*models.WalletState, 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 ValidateClientPayload(payload *entities.ClientPayload, strictAuth bool) (*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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizeAgent ¶
func AuthorizeAgent( payload entities.ClientPayload, ctx *context.Context, ) (*models.AuthorizationEvent, error)
Validate and Process the authorization request
Validate and Process the authorization request
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 GetAuthorizationEventById ¶
func GetAuthorizationEventById(id string) (*models.AuthorizationEvent, error)
func GetBlockStats ¶
func GetMainStats ¶
func GetMessageEventById ¶
func GetMessageEventById(id string) (*models.MessageEvent, error)
func GetMessages ¶
func GetMessages(topicId string) (*[]models.MessageState, 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 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 GetSubscription ¶
func GetSubscription(id string) (*models.SubscriptionState, error)
func GetSubscriptions ¶
func GetSubscriptions(payload entities.Subscription) (*[]models.SubscriptionState, error)
func GetTopic ¶
func GetTopic(where models.TopicState) (*models.TopicState, error)
func GetTopicByHash ¶
func GetTopicByHash(hash string) (*models.TopicState, error)
func GetTopicById ¶
func GetTopicById(id string) (*models.TopicState, error)
func GetTopicEventById ¶
func GetTopicEventById(id string) (*models.TopicEvent, error)
func GetTopicEvents ¶
func GetTopicEvents() (*[]models.TopicEvent, error)
func GetTopics ¶
func GetTopics() (*[]models.TopicState, error)
func GetWalletByHash ¶
func GetWalletByHash(hash string) (*models.WalletState, error)
func GetWalletById ¶
func GetWalletById(id string) (*models.WalletState, 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 ValidateClientPayload ¶
func ValidateClientPayload( payload *entities.ClientPayload, strictAuth bool, ) (*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
Click to show internal directories.
Click to hide internal directories.