service

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: LGPL-2.1 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectClient

func ConnectClient(message []byte, protocol constants.Protocol, client interface{}) (*entities.ClientHandshake, error)

func HandleNewPubSubAuthEvent

func HandleNewPubSubAuthEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubEvent added in v1.2.0

func HandleNewPubSubEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubMessageEvent

func HandleNewPubSubMessageEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubSubnetEvent

func HandleNewPubSubSubnetEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubSubscriptionEvent

func HandleNewPubSubSubscriptionEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubTopicEvent

func HandleNewPubSubTopicEvent(event *entities.Event, ctx *context.Context)

func HandleNewPubSubWalletEvent

func HandleNewPubSubWalletEvent(event *entities.Event, ctx *context.Context)

func IsMoreRecent

func IsMoreRecent(
	currenStatetEventId string,
	currenStatetHash string,
	currentStateEventTimestamp uint64,
	eventHash string,
	eventPayloadTimestamp uint64,
	markedAsSynced bool,
) (isMoreRecent bool, markAsSynced bool)

func IsMoreRecentEvent added in v1.2.0

func IsMoreRecentEvent(
	eventHash string,
	eventTimestamp int,
	event2Hash string,
	event2Timestamp int,
) bool

func OnFinishProcessingEvent added in v1.2.0

func OnFinishProcessingEvent(ctx *context.Context, eventPath *entities.EventPath, subnetId *string, err error)

func ProcessEvent added in v1.2.0

func ProcessEvent(event *entities.Event, data PayloadData, validAgentRequired bool, saveEvent func(entities.Event, *entities.Event, *entities.Event, *gorm.DB) (*entities.Event, error), tx *gorm.DB, ctx *context.Context) (bool, bool, *models.AuthorizationState, bool, error)

func ValidateAuthPayloadData added in v1.2.0

func ValidateAuthPayloadData(clientPayload *entities.ClientPayload, chainId configs.ChainId) (prevAuthState *models.AuthorizationState, grantorAuthState *models.AuthorizationState, subnet *models.SubnetState, err error)

func ValidateEvent

func ValidateEvent(event interface{}) error

func ValidateMessageClient

func ValidateMessageClient(
	ctx *context.Context,
	clientHandshake *entities.ClientHandshake,
) error

func ValidateMessageData

func ValidateMessageData(payload *entities.ClientPayload, topic *entities.Topic) (currentSubscription *models.SubscriptionState, err error)

Validate an agent authorization

func ValidateSubnetData

func ValidateSubnetData(clientPayload *entities.ClientPayload, chainID configs.ChainId) (currentSubnetState *models.SubnetState, err error)

Validate an agent authorization

func ValidateSubscriptionData

func ValidateSubscriptionData(payload *entities.ClientPayload, topic *entities.Topic) (currentSubscriptionState *models.SubscriptionState, err error)

Validate an agent authorization

func ValidateTopicData

func ValidateTopicData(topic *entities.Topic, authState *models.AuthorizationState) (currentTopicState *models.TopicState, err error)

Validate an agent authorization

func ValidateWalletData

func ValidateWalletData(Wallet *entities.Wallet) (currentWalletState *models.WalletState, err error)

Validate an agent authorization

Types

type LocalDataState added in v1.2.0

type LocalDataState struct {
	Hash      string
	ID        string
	Event     *entities.EventPath
	Timestamp uint64
}

type LocalDataStateEvent added in v1.2.0

type LocalDataStateEvent struct {
	Hash      string
	ID        string
	Timestamp uint64
}

type PayloadData added in v1.2.0

type PayloadData struct {
	Subnet string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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