Documentation
¶
Overview ¶
Package aries is implementation package for didcomm messages. See related package mesg which is for our legacy messages. Both aries and mesg messages share same interfaces defined in the didcomm package. didcomm defines a message factor interfaces as well. With the help of the factoring system, the actual messages can be constructed from the incoming messages with the correct type. We use statically typed JSON messages i.e. they are always mapped to corresponding Go struct.
Index ¶
- Variables
- func ProtocolForType(typeStr string) string
- func ProtocolMsgForType(typeStr string) string
- type Factor
- type Msg
- type MsgFactor
- type MsgImpl
- func (m *MsgImpl) ConnectionInvitation() *didexchange.Invitation
- func (m *MsgImpl) CredDefID() *string
- func (m *MsgImpl) CredentialAttributes() *[]didcomm.CredentialAttribute
- func (m *MsgImpl) Did() string
- func (m *MsgImpl) Endpoint() service.Addr
- func (m *MsgImpl) Error() string
- func (m *MsgImpl) FieldObj() interface{}
- func (m *MsgImpl) ID() string
- func (m *MsgImpl) Info() string
- func (m *MsgImpl) JSON() []byte
- func (m *MsgImpl) Name() string
- func (m *MsgImpl) Nonce() string
- func (m *MsgImpl) ProofAttributes() *[]didcomm.ProofAttribute
- func (m *MsgImpl) ProofValues() *[]didcomm.ProofValue
- func (m *MsgImpl) Ready() bool
- func (m *MsgImpl) ReceiverEP() service.Addr
- func (m *MsgImpl) Schema() *ssi.Schema
- func (m *MsgImpl) SetBody(b interface{})
- func (m *MsgImpl) SetDid(s string)
- func (m *MsgImpl) SetError(s string)
- func (m *MsgImpl) SetID(id string)
- func (m *MsgImpl) SetInfo(s string)
- func (m *MsgImpl) SetInvitation(i *didexchange.Invitation)
- func (m *MsgImpl) SetNonce(n string)
- func (m *MsgImpl) SetReady(yes bool)
- func (m *MsgImpl) SetSchema(sch *ssi.Schema)
- func (m *MsgImpl) SetSubLevelID(s string)
- func (m *MsgImpl) SetSubMsg(sm map[string]interface{})
- func (m *MsgImpl) SetType(t string)
- func (m *MsgImpl) SetVerKey(s string)
- func (m *MsgImpl) SubLevelID() string
- func (m *MsgImpl) SubMsg() map[string]interface{}
- func (m *MsgImpl) Thread() *decorator.Thread
- func (m *MsgImpl) TimestampMs() *uint64
- func (m *MsgImpl) Type() string
- func (m *MsgImpl) VerKey() string
- type PayloadFactor
- type PayloadImpl
- func (pl *PayloadImpl) Creator() didcomm.PayloadFactor
- func (pl *PayloadImpl) Data() []byte
- func (pl *PayloadImpl) FieldObj() interface{}
- func (pl *PayloadImpl) ID() string
- func (pl *PayloadImpl) Message() didcomm.Msg
- func (pl *PayloadImpl) MsgCreator() didcomm.MsgFactor
- func (pl *PayloadImpl) MsgHdr() didcomm.MessageHdr
- func (pl *PayloadImpl) Namespace() string
- func (pl *PayloadImpl) Protocol() string
- func (pl *PayloadImpl) ProtocolMsg() string
- func (pl *PayloadImpl) SetThread(t *decorator.Thread)
- func (pl *PayloadImpl) ThreadID() string
- func (pl *PayloadImpl) Type() string
Constants ¶
This section is empty.
Variables ¶
var MsgCreator = MsgFactor{}
var PayloadCreator = PayloadFactor{}
Functions ¶
func ProtocolForType ¶ added in v0.25.7
func ProtocolMsgForType ¶ added in v0.25.7
Types ¶
type Msg ¶
type Msg struct {
Type string `json:"@type,omitempty"`
AID string `json:"@id,omitempty"`
Thread *decorator.Thread `json:"~thread,omitempty"`
Error string `json:"error,omitempty"` // If error happens includes error msg
Encrypted string `json:"encrypted,omitempty"` // If the whole msg is encrypted is transferred in this field
Did string `json:"did,omitempty"` // Usually senders DID and corresponding VerKey
VerKey string `json:"verkey,omitempty"` // Senders Verkey for DID
RcvrEndp string `json:"rcvr_endp,omitempty"` // Receivers own endpoint, usually the public URL
RcvrKey string `json:"rcvr_key,omitempty"` // Receiver endpoint ver key
Endpoint string `json:"endpoint,omitempty"` // Multipurpose field which still is under design
EndpVerKey string `json:"endp_ver_key,omitempty"` // VerKey associated to endpoint i.e. payload verkey
Name string `json:"name,omitempty"` // Multipurpose field which still is under design
Info string `json:"info,omitempty"` // Used for transferring additional info like the Msg in IM-cases, and Pairwise name
ID string `json:"id,omitempty"` // Used for transferring additional ID like the Cred Def ID
Ready bool `json:"ready,omitempty"` // In queries tells if something is ready when true
Msg map[string]interface{} `json:"msg,omitempty"` // Generic sub message to transport JSON between Indy SDK and EAs
}
func (*Msg) SetEndpoint ¶
func (*Msg) SetRcvrEndp ¶
type MsgFactor ¶
type MsgFactor struct{}
func (MsgFactor) NewMessage ¶
func (f MsgFactor) NewMessage(data []byte) didcomm.MessageHdr
type MsgImpl ¶
type MsgImpl struct {
*Msg
}
func (*MsgImpl) ConnectionInvitation ¶
func (m *MsgImpl) ConnectionInvitation() *didexchange.Invitation
func (*MsgImpl) CredentialAttributes ¶
func (m *MsgImpl) CredentialAttributes() *[]didcomm.CredentialAttribute
func (*MsgImpl) ProofAttributes ¶
func (m *MsgImpl) ProofAttributes() *[]didcomm.ProofAttribute
func (*MsgImpl) ProofValues ¶
func (m *MsgImpl) ProofValues() *[]didcomm.ProofValue
func (*MsgImpl) ReceiverEP ¶
func (*MsgImpl) SetInvitation ¶
func (m *MsgImpl) SetInvitation(i *didexchange.Invitation)
func (*MsgImpl) SetSubLevelID ¶
func (*MsgImpl) SubLevelID ¶
func (*MsgImpl) TimestampMs ¶
type PayloadFactor ¶
type PayloadFactor struct{}
func (PayloadFactor) New ¶
func (f PayloadFactor) New(pi didcomm.PayloadInit) didcomm.Payload
New creates a new Aries PL with PayloadInit struct. The type of the Msg is generic.
func (PayloadFactor) NewFromData ¶
func (f PayloadFactor) NewFromData(data []byte) didcomm.Payload
NewFromData creates a new Aries PL in correct Go struct type. If @Type is associated to Go struct type which is registered to this Factor, it's used. If not a generic type is used.
func (PayloadFactor) NewMsg ¶
func (f PayloadFactor) NewMsg(id, t string, m didcomm.MessageHdr) didcomm.Payload
NewMsg creates a new PL by ID, Type and already created internal Msg.
type PayloadImpl ¶
type PayloadImpl struct {
didcomm.MessageHdr
}
func (*PayloadImpl) Creator ¶
func (pl *PayloadImpl) Creator() didcomm.PayloadFactor
func (*PayloadImpl) Data ¶
func (pl *PayloadImpl) Data() []byte
func (*PayloadImpl) FieldObj ¶
func (pl *PayloadImpl) FieldObj() interface{}
func (*PayloadImpl) ID ¶
func (pl *PayloadImpl) ID() string
func (*PayloadImpl) Message ¶
func (pl *PayloadImpl) Message() didcomm.Msg
func (*PayloadImpl) MsgCreator ¶
func (pl *PayloadImpl) MsgCreator() didcomm.MsgFactor
func (*PayloadImpl) MsgHdr ¶
func (pl *PayloadImpl) MsgHdr() didcomm.MessageHdr
func (*PayloadImpl) Namespace ¶
func (pl *PayloadImpl) Namespace() string
func (*PayloadImpl) Protocol ¶
func (pl *PayloadImpl) Protocol() string
func (*PayloadImpl) ProtocolMsg ¶
func (pl *PayloadImpl) ProtocolMsg() string
func (*PayloadImpl) SetThread ¶
func (pl *PayloadImpl) SetThread(t *decorator.Thread)
func (*PayloadImpl) ThreadID ¶
func (pl *PayloadImpl) ThreadID() string
func (*PayloadImpl) Type ¶
func (pl *PayloadImpl) Type() string