Documentation
¶
Index ¶
- Constants
- func Publish(subject string, message any) error
- func PublishSync(subject string, message any) error
- func QueueSubscribe(subject, queue string, handler MessageHandler) error
- type MessageHandler
- type NodeCreatedData
- type NodeValidatedData
- type NodeValidationFailedData
- type Publisher
- type Subscriber
Constants ¶
View Source
const ( // NodeCreated is the subject for an event where a node has been created. NodeCreated = "NODES.created" // NodeValidated is the subject for an event where a node has been // successfully validated. NodeValidated = "NODES.validated" // NodeValidationFailed is the subject for an event where a node's validation // has failed. NodeValidationFailed = "NODES.validation_failed" )
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
Publish checks for an existing Publisher instance or creates one, and then publishes the message to the specified subject.
func PublishSync ¶
func QueueSubscribe ¶
func QueueSubscribe( subject, queue string, handler MessageHandler, ) error
QueueSubscribe checks for an existing Subscriber instance or creates one, and then subscribes to the specified queue.
Types ¶
type MessageHandler ¶
type NodeCreatedData ¶
type NodeValidatedData ¶
type NodeValidatedData struct {
// ProfileURL is the URL of the profile associated with the node.
ProfileURL string `json:"profile_url"`
// ProfileHash is the hash of the profile data.
ProfileHash string `json:"profile_hash"`
// ProfileStr is a string representation of the profile data.
ProfileStr string `json:"profile_str"`
// LastUpdated is a Unix timestamp indicating when the node data was last updated.
LastUpdated int64 `json:"last_updated"`
// Version is the version vector of the node.
// https://en.wikipedia.org/wiki/Version_vector
Version int32 `json:"version"`
// Expires is a string representing the expiration date of the node.
// It's optional and can be empty if the node doesn't have an expiration date.
Expires *int64 `json:"expires,omitempty"`
}
NodeValidatedData represents the validated data of a node.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.