models

package
v0.38.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments map[string]string

type BaseMessageRequest

type BaseMessageRequest struct {
	Action string `json:"action"` // Action type of the request
}

BaseMessageRequest represents a base structure for incoming messages.

type BaseMessageResponse

type BaseMessageResponse struct {
	Action       string `json:"action,omitempty"`        // Action type of the response
	Success      bool   `json:"success"`                 // Indicates success or failure
	ErrorMessage string `json:"error_message,omitempty"` // Error message, if any
}

BaseMessageResponse represents a base structure for outgoing messages.

type BlockDigestMessageResponse

type BlockDigestMessageResponse struct {
	// The sealed or finalized block digest according to the block status
	// in the request.
	Block *flow.BlockDigest `json:"block_digest"`
}

BlockDigestMessageResponse is the response message for 'block_digests' topic.

type BlockHeaderMessageResponse

type BlockHeaderMessageResponse struct {
	// The sealed or finalized block headers according to the block status
	// in the request.
	Header *flow.Header `json:"header"`
}

BlockHeaderMessageResponse is the response message for 'block_headers' topic.

type BlockMessageResponse

type BlockMessageResponse struct {
	// The sealed or finalized blocks according to the block status
	// in the request.
	Block *flow.Block `json:"block"`
}

BlockMessageResponse is the response message for 'blocks' topic.

type ListSubscriptionsMessageRequest

type ListSubscriptionsMessageRequest struct {
	BaseMessageRequest
}

ListSubscriptionsMessageRequest represents a request to list active subscriptions.

type ListSubscriptionsMessageResponse

type ListSubscriptionsMessageResponse struct {
	BaseMessageResponse
	Subscriptions []*SubscriptionEntry `json:"subscriptions,omitempty"`
}

ListSubscriptionsMessageResponse is the structure used to respond to list_subscriptions requests. It contains a list of active subscriptions for the current WebSocket connection.

type SubscribeMessageRequest

type SubscribeMessageRequest struct {
	BaseMessageRequest
	Topic     string    `json:"topic"`     // Topic to subscribe to
	Arguments Arguments `json:"arguments"` // Additional arguments for subscription
}

SubscribeMessageRequest represents a request to subscribe to a topic.

type SubscribeMessageResponse

type SubscribeMessageResponse struct {
	BaseMessageResponse
	Topic string `json:"topic"` // Topic of the subscription
	ID    string `json:"id"`    // Unique subscription ID
}

SubscribeMessageResponse represents the response to a subscription request.

type SubscriptionEntry

type SubscriptionEntry struct {
	Topic string `json:"topic,omitempty"` // Topic of the subscription
	ID    string `json:"id,omitempty"`    // Unique subscription ID
}

SubscriptionEntry represents an active subscription entry.

type UnsubscribeMessageRequest

type UnsubscribeMessageRequest struct {
	BaseMessageRequest
	ID string `json:"id"` // Unique subscription ID
}

UnsubscribeMessageRequest represents a request to unsubscribe from a topic.

type UnsubscribeMessageResponse

type UnsubscribeMessageResponse struct {
	BaseMessageResponse
	ID string `json:"id"` // Unique subscription ID
}

UnsubscribeMessageResponse represents the response to an unsubscription request.

Jump to

Keyboard shortcuts

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