-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessage.go
30 lines (22 loc) · 904 Bytes
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package iden3comm
import "encoding/json"
// MediaType is media type for iden3comm messages
type MediaType string
// BasicMessage is structure for message with unknown body format
type BasicMessage struct {
ID string `json:"id"`
Typ MediaType `json:"typ,omitempty"`
Type ProtocolMessage `json:"type"`
ThreadID string `json:"thid,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
CreatedTime *int64 `json:"created_time,omitempty"`
ExpiresTime *int64 `json:"expires_time,omitempty"`
}
// ProtocolMessage is IDEN3Comm message
type ProtocolMessage string
// Iden3Protocol is a const for protocol definition
const Iden3Protocol = "https://iden3-communication.io/"
// DidCommProtocol is a const for didcomm protocol definition
const DidCommProtocol = "https://didcomm.org/"