add new struct
This commit is contained in:
@@ -15,6 +15,41 @@ const DEFAULT_NATS_URL = "nats://localhost:4222" # Default NATS server URL
|
|||||||
const DEFAULT_FILESERVER_URL = "http://localhost:8080/upload" # Default HTTP file server URL for link transport
|
const DEFAULT_FILESERVER_URL = "http://localhost:8080/upload" # Default HTTP file server URL for link transport
|
||||||
|
|
||||||
|
|
||||||
|
struct msgEnvelope_v1
|
||||||
|
correlationId::String # Unique identifier to track messages across systems. Many senders can talk about the same topic.
|
||||||
|
msgId::String # this message id
|
||||||
|
timestamp::String # message published timestamp. string(Dates.now())
|
||||||
|
|
||||||
|
sendTo::String # topic/subject the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
||||||
|
msgPurpose::Sting # purpose of this message e.g. "ACK | NACK | updateStatus | shutdown | ..."
|
||||||
|
senderName::Sting # sender name (String) e.g. "agent-wine-web-frontend"
|
||||||
|
senderId::String # sender id e.g. uuid4snakecase()
|
||||||
|
receiverName::String # msg receiver name (String) e.g. "agent-backend"
|
||||||
|
receiverId::String # msg receiver id, nothing means everyone in the topic e.g. uuid4snakecase()
|
||||||
|
|
||||||
|
replyTo::String # sender ask receiver to reply to this topic
|
||||||
|
replyToMsgId::String # the message id this message is replying to
|
||||||
|
BrokerURL::String # mqtt/NATS server address
|
||||||
|
|
||||||
|
note::Dict{String, Any} # used to store additional info
|
||||||
|
payloads::Dict{String, Any} #
|
||||||
|
end
|
||||||
|
|
||||||
|
#[WORKING]
|
||||||
|
struct msgPayload_v1
|
||||||
|
id::String # id of this payload
|
||||||
|
dataname::String # name of this payload
|
||||||
|
type::String # "text | json | table | image | audio | video | binary"
|
||||||
|
transport::String # "direct | link"
|
||||||
|
encoding::String # "none | json | base64 | arrow-ipc"
|
||||||
|
size::Integer # data size in bytes e.g. 15433
|
||||||
|
data::Any # payload data in case of direct transport or URL in case of link
|
||||||
|
metadata::Dict{String, Any} # Dict("checksum=> "sha256_hash", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
""" Struct for the unified JSON envelope
|
""" Struct for the unified JSON envelope
|
||||||
This struct represents a standardized message format that can carry either
|
This struct represents a standardized message format that can carry either
|
||||||
direct payload data or a URL reference, allowing flexible transport strategies
|
direct payload data or a URL reference, allowing flexible transport strategies
|
||||||
|
|||||||
Reference in New Issue
Block a user